Components/Charts/LineChart

LineChart

Charts

Multi-series line chart with tooltip and legend.

Multi-line trend chart. curveType controls interpolation (linear, monotone, step). withDots adds data point markers.

Usage

import { LineChart } from "nosible-ux"

const data = [
  { week: "W1", confidence: 82, volume: 140 },
  { week: "W2", confidence: 87, volume: 165 },
  { week: "W3", confidence: 79, volume: 130 },
]

export default function Example() {
  return (
    <LineChart
      data={data}
      dataKey="week"
      series={[{ name: "confidence" }, { name: "volume" }]}
      withLegend
      withTooltip
    />
  )
}

Examples

Step curve for discrete events

Props

Name TypeDefaultDescription
aria-label
string | undefinedAccessible label forwarded to the `role="img"` wrapper.
curveType
"step" | "linear" | "monotone" | undefinedLine interpolation style. Default: `"monotone"`.
data
Record<string, unknown>[]Array of data objects keyed by `dataKey` + series names.
dataKey
stringKey used for the X-axis categories.
h
number | undefinedContainer height in px. Default: `300`.
series
LineChartSeries[]Series definitions — one line rendered per entry.
withDots
boolean | undefinedShow dot markers at every data point. Default: `false`.
withLegend
boolean | undefinedLegend below the chart. Default: `true`.
withTooltip
boolean | undefinedBranded tooltip on hover. Default: `true`.
withXAxis
boolean | undefinedRender the X-axis. Default: `true`.
withYAxis
boolean | undefinedRender the Y-axis. Default: `true`.