- Prop
curve- Type
CurveKind | undefined- Default
- —
- Requirement
- optional
- Description
- Curve interpolation between points.
LineChart
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- surface
- —
- marks
- —
- size
- —
- value
- —
ts
import { useState, type ComponentProps } from "react";import { t6LineChartFixture } from "@grassroot/demo-fixtures";import { LineChart } from "@grassroot/charts-react";import type { CurveKind } from "@grassroot/charts-react"; /** Ordered loosest-to-tightest fit, so stepping through the toggles reads as a * progression rather than an arbitrary list. */const CURVES: readonly CurveKind[] = ["linear", "monotone-x", "catmull-rom", "basis", "step"];const FIXTURE = t6LineChartFixture.props() as unknown as ComponentProps<typeof LineChart>; export default function LineChartDemo() { const [curve, setCurve] = useState<CurveKind>("linear"); return ( <div> <div className="gr-demo-toggles" role="group" aria-label="Curve interpolation"> {CURVES.map((kind) => ( <button key={kind} type="button" aria-pressed={curve === kind} onClick={() => setCurve(kind)} > {kind} </button> ))} </div> <LineChart {...FIXTURE} ariaLabel="Line chart" curve={curve} /> </div> );}- surface
- —
- marks
- —
- size
- —
- value
- —
ts
<script setup lang="ts">import { ref } from "vue";import { t6LineChartFixture } from "@grassroot/demo-fixtures";import { LineChart } from "@grassroot/charts-vue";import type { CurveKind } from "@grassroot/charts-vue";import type { ChartXDomain } from "@grassroot/ui-machines/chart-shell"; const props = defineProps<{ onSelectedIdsChange?: (ids: readonly string[]) => void; onBrushDomainChange?: (domain: ChartXDomain) => void; onZoomDomainChange?: (domain: ChartXDomain) => void;}>(); const CURVES: readonly CurveKind[] = ["linear", "monotone-x", "catmull-rom", "basis", "step"];const curve = ref<CurveKind>("linear");</script><template> <div> <div class="gr-demo-toggles" role="group" aria-label="Curve interpolation"> <button v-for="kind in CURVES" :key="kind" type="button" :aria-pressed="curve === kind" @click="curve = kind" > {{ kind }} </button> </div> <LineChart v-bind="{ ...t6LineChartFixture.props(), ariaLabel: 'Line chart', ...$attrs }" :curve="curve" @selected-ids-change="props.onSelectedIdsChange?.($event)" @brush-domain-change="props.onBrushDomainChange?.($event)" @zoom-domain-change="props.onZoomDomainChange?.($event)" /> </div></template>- surface
- —
- marks
- —
- size
- —
- value
- —
ts
import { ChangeDetectionStrategy, Component, signal } from "@angular/core";import { t6LineChartFixture } from "@grassroot/demo-fixtures";import { GrassrootLineChart } from "@grassroot/charts-angular";import type { CurveKind } from "@grassroot/charts-angular"; const CURVES: readonly CurveKind[] = ["linear", "monotone-x", "catmull-rom", "basis", "step"]; @Component({ selector: "app-line-chart-chart-demo", standalone: true, imports: [GrassrootLineChart], changeDetection: ChangeDetectionStrategy.OnPush, template: `<div> <div class="gr-demo-toggles" role="group" aria-label="Curve interpolation"> @for (kind of curves; track kind) { <button type="button" [attr.aria-pressed]="curve() === kind" (click)="curve.set(kind)"> {{ kind }} </button> } </div> <grassroot-line-chart [series]="fixture.series" [ariaLabel]="'Line chart'" [tooltip]="fixture.tooltip" [legend]="fixture.legend" [curve]="curve()" [selectionMode]="fixture.selectionMode" [selectedIds]="fixture.defaultSelectedIds" [brushDomain]="fixture.defaultBrushDomain" [zoomDomain]="fixture.defaultZoomDomain" [zoomOnBrush]="fixture.zoomOnBrush" (selectedIdsChange)="selected($event)" (brushDomainChange)="brushed($event)" (zoomDomainChange)="zoomed($event)" /> </div>`,})export class LineChartDemoComponent { readonly fixture = t6LineChartFixture.props(); readonly curves = CURVES; readonly curve = signal<CurveKind>("linear"); protected selected(ids: readonly string[]): void { this.callback("onSelectedIdsChange", ids); } protected brushed(domain: unknown): void { this.callback("onBrushDomainChange", domain); } protected zoomed(domain: unknown): void { this.callback("onZoomDomainChange", domain); } private callback(key: string, value: unknown): void { const callback = this.bind(key); if (typeof callback === "function") callback(value); }}export default LineChartDemoComponent;- surface
- —
- marks
- —
- size
- —
- value
- —
ts
<script lang="ts"> import { t6LineChartFixture } from "@grassroot/demo-fixtures"; import { LineChart } from "@grassroot/charts-svelte"; import type { CurveKind } from "@grassroot/charts-svelte"; const CURVES: readonly CurveKind[] = ["linear", "monotone-x", "catmull-rom", "basis", "step"]; let curve = $state<CurveKind>("linear");</script> <div> <div class="gr-demo-toggles" role="group" aria-label="Curve interpolation"> {#each CURVES as kind (kind)} <button type="button" aria-pressed={curve === kind} onclick={() => (curve = kind)}> {kind} </button> {/each} </div> <LineChart {...t6LineChartFixture.props()} ariaLabel="Line chart" {curve} /></div>- surface
- —
- marks
- —
- size
- —
- value
- —
ts
/** @jsxImportSource solid-js */import { For, createSignal, type ComponentProps } from "solid-js";import { t6LineChartFixture } from "@grassroot/demo-fixtures";import { LineChart } from "@grassroot/charts-solid";import type { CurveKind } from "@grassroot/charts-solid"; const CURVES: readonly CurveKind[] = ["linear", "monotone-x", "catmull-rom", "basis", "step"];const FIXTURE = t6LineChartFixture.props() as unknown as ComponentProps<typeof LineChart>; export default function LineChartDemo() { const [curve, setCurve] = createSignal<CurveKind>("linear"); return ( <div> <div class="gr-demo-toggles" role="group" aria-label="Curve interpolation"> <For each={CURVES}> {(kind) => ( <button type="button" aria-pressed={curve() === kind} onClick={() => setCurve(kind)}> {kind} </button> )} </For> </div> <LineChart {...FIXTURE} ariaLabel="Line chart" curve={curve()} /> </div> );}Installation
API Reference
Import
import { useState, type ComponentProps } from "react";
import { t6LineChartFixture } from "@grassroot/demo-fixtures";
import { LineChart } from "@grassroot/charts-react";
import type { CurveKind } from "@grassroot/charts-react";
Props
Prop
Type
Default
Requirement
Description
curveCurveKind | undefined—
optional
Curve interpolation between points.
liveboolean | undefined—
optional
Adds the live endpoint glow and keeps the streaming state semantic.
seriesChartSeries[]—
required
—
maxnumber | undefined—
optional
—
xDomainChartNumericDomain | ChartTimeDomain | undefined—
optional
—
xScale"linear" | "log" | undefined—
optional
—
yDomainChartNumericDomain | undefined—
optional
—
xAxisChartAxisOptions<number | Date> | undefined—
optional
—
yAxisChartAxisOptions<number> | undefined—
optional
—
showGridboolean | undefined—
optional
—
formatXTick((value: number | Date, index: number) => string) | undefined—
optional
—
formatYTick((value: number, index: number) => string) | undefined—
optional
—
speednumber | undefined—
optional
Playback-speed multiplier for entrance/ambient motion.
morphDurationMsnumber | undefined—
optional
How long a dataset change tweens, in ms.
- Prop
live- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- Adds the live endpoint glow and keeps the streaming state semantic.
- Prop
series- Type
ChartSeries[]- Default
- —
- Requirement
- required
- Description
- —
- Prop
max- Type
number | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
xDomain- Type
ChartNumericDomain | ChartTimeDomain | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
xScale- Type
"linear" | "log" | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
yDomain- Type
ChartNumericDomain | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
xAxis- Type
ChartAxisOptions<number | Date> | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
yAxis- Type
ChartAxisOptions<number> | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
showGrid- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
formatXTick- Type
((value: number | Date, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
formatYTick- Type
((value: number, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
speed- Type
number | undefined- Default
- —
- Requirement
- optional
- Description
- Playback-speed multiplier for entrance/ambient motion.
- Prop
morphDurationMs- Type
number | undefined- Default
- —
- Requirement
- optional
- Description
- How long a dataset change tweens, in ms.
- Prop
replayToken- Type
string | number | undefined- Default
- —
- Requirement
- optional
- Description
- Changing this value replays the entrance animation.
- Prop
selectionMode- Type
SelectionMode | undefined- Default
- —
- Requirement
- optional
- Description
- Enables the shared selection child.
- Prop
selectedIds- Type
SelectionValue | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultSelectedIds- Type
SelectionValue | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onSelectedIdsChange- Type
((ids: readonly string[]) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
brushDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultBrushDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onBrushDomainChange- Type
((domain: ChartXDomain) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
zoomDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultZoomDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onZoomDomainChange- Type
((domain: ChartXDomain) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
zoomOnBrush- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- Commits a brush as a zoom request.
- Prop
formatXValue- Type
((value: number | Date | string, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
formatYValue- Type
((value: number, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
locale- Type
string | readonly string[] | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
timeZone- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
invalidData- Type
LineChartInvalidDataPolicy | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
referenceLines- Type
readonly ReferenceLine[] | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
referenceBands- Type
readonly ReferenceBand[] | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
renderer- Type
import("@grassroot/core").ChartRenderer | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
className- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
theme- Type
import("@grassroot/theme").PartialChartTheme | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
animation- Type
import("@grassroot/theme").ChartAnimationInput | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
title- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
description- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
ariaLabel- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
keyboardNavigation- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
interactive- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
tooltip- Type
boolean | import("../../types").TooltipConfig<ChartXYDatum> | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
crosshair- Type
boolean | import("../../types").CrosshairConfig | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
legend- Type
boolean | LegendConfig | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
activePoint- Type
ActivePoint<ChartXYDatum> | null | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultActivePoint- Type
ActivePoint<ChartXYDatum> | null | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onActivePointChange- Type
((point: ActivePoint<ChartXYDatum> | null) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
hiddenSeries- Type
readonly string[] | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
defaultHiddenSeries- Type
readonly string[] | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
onHiddenSeriesChange- Type
((hidden: readonly string[]) => void) | undefined- Default
- —
- Requirement
- optional
- Description
- —
Events
| Event | Payload |
|---|---|
onSelectedIdsChange | ((ids: readonly string[]) => void) | undefined |
onBrushDomainChange | ((domain: ChartXDomain) => void) | undefined |
onZoomDomainChange | ((domain: ChartXDomain) => void) | undefined |
onActivePointChange | ((point: ActivePoint<ChartXYDatum> | null) => void) | undefined |
onHiddenSeriesChange | ((hidden: readonly string[]) => void) | undefined |
Content regions
childrendataSummary
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.
Import
import { ref } from "vue";
import { t6LineChartFixture } from "@grassroot/demo-fixtures";
import { LineChart } from "@grassroot/charts-vue";
import type { CurveKind } from "@grassroot/charts-vue";
import type { ChartXDomain } from "@grassroot/ui-machines/chart-shell";
Props
Prop
Type
Default
Requirement
seriesreadonly ChartSeries[]—
required
maxnumber | undefined—
optional
xDomainChartNumericDomain | ChartTimeDomain | undefined—
optional
xScale"linear" | "log" | undefined—
optional
yDomainChartNumericDomain | undefined—
optional
xAxisChartAxisOptions<number | Date> | undefined—
optional
yAxisChartAxisOptions<number> | undefined—
optional
showGridboolean | undefinedfalseoptional
curveCurveKind | undefined—
optional
liveboolean | undefinedfalseoptional
formatXTick((value: number | Date, index: number) => string) | undefined—
optional
formatYTick((value: number, index: number) => string) | undefined—
optional
formatXValue((value: number | Date | string, index: number) => string) | undefined—
optional
formatYValue((value: number, index: number) => string) | undefined—
optional
- Prop
series- Type
readonly ChartSeries[]- Default
- —
- Requirement
- required
- Prop
max- Type
number | undefined- Default
- —
- Requirement
- optional
- Prop
xDomain- Type
ChartNumericDomain | ChartTimeDomain | undefined- Default
- —
- Requirement
- optional
- Prop
xScale- Type
"linear" | "log" | undefined- Default
- —
- Requirement
- optional
- Prop
yDomain- Type
ChartNumericDomain | undefined- Default
- —
- Requirement
- optional
- Prop
xAxis- Type
ChartAxisOptions<number | Date> | undefined- Default
- —
- Requirement
- optional
- Prop
yAxis- Type
ChartAxisOptions<number> | undefined- Default
- —
- Requirement
- optional
- Prop
showGrid- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
curve- Type
CurveKind | undefined- Default
- —
- Requirement
- optional
- Prop
live- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
formatXTick- Type
((value: number | Date, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Prop
formatYTick- Type
((value: number, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Prop
formatXValue- Type
((value: number | Date | string, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Prop
formatYValue- Type
((value: number, index: number) => string) | undefined- Default
- —
- Requirement
- optional
- Prop
locale- Type
string | readonly string[] | undefined- Default
- —
- Requirement
- optional
- Prop
timeZone- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
invalidData- Type
LineChartInvalidDataPolicy | undefined- Default
- —
- Requirement
- optional
- Prop
referenceLines- Type
readonly ReferenceLine[] | undefined- Default
- —
- Requirement
- optional
- Prop
referenceBands- Type
readonly ReferenceBand[] | undefined- Default
- —
- Requirement
- optional
- Prop
renderer- Type
ChartRenderer | undefined- Default
- —
- Requirement
- optional
- Prop
ariaLabel- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
className- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
title- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
description- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
theme- Type
PartialChartTheme | undefined- Default
- —
- Requirement
- optional
- Prop
animation- Type
ChartAnimationInput | undefined- Default
- —
- Requirement
- optional
- Prop
interactive- Type
boolean | undefined- Default
true- Requirement
- optional
- Prop
crosshair- Type
boolean | CrosshairBehaviorConfig | undefined- Default
true- Requirement
- optional
- Prop
keyboardNavigation- Type
boolean | undefined- Default
true- Requirement
- optional
- Prop
tooltip- Type
boolean | TooltipBehaviorConfig | undefined- Default
true- Requirement
- optional
- Prop
legend- Type
boolean | LegendConfig | undefined- Default
false- Requirement
- optional
- Prop
hiddenSeries- Type
readonly string[] | undefined- Default
- —
- Requirement
- optional
- Prop
defaultHiddenSeries- Type
readonly string[] | undefined- Default
() => []- Requirement
- optional
- Prop
activePoint- Type
ActivePoint<ChartXYDatum> | null | undefined- Default
- —
- Requirement
- optional
- Prop
defaultActivePoint- Type
ActivePoint<ChartXYDatum> | null | undefined- Default
null- Requirement
- optional
- Prop
selectionMode- Type
SelectionMode | undefined- Default
"none"- Requirement
- optional
- Prop
selectedIds- Type
readonly string[] | undefined- Default
- —
- Requirement
- optional
- Prop
defaultSelectedIds- Type
readonly string[] | undefined- Default
- —
- Requirement
- optional
- Prop
brushDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Prop
defaultBrushDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Prop
zoomDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Prop
defaultZoomDomain- Type
ChartXDomain | undefined- Default
- —
- Requirement
- optional
- Prop
zoomOnBrush- Type
boolean | undefined- Default
false- Requirement
- optional
- Prop
speed- Type
number | undefined- Default
- —
- Requirement
- optional
- Prop
morphDurationMs- Type
number | undefined- Default
- —
- Requirement
- optional
- Prop
replayToken- Type
string | number | undefined- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
activePointChange | [point: ActivePoint<ChartXYDatum> | null] |
hiddenSeriesChange | [ids: readonly string[]] |
selectedIdsChange | [ids: readonly string[]] |
brushDomainChange | [domain: ChartXDomain] |
zoomDomainChange | [domain: ChartXDomain] |
Content regions
dataSummarydefault
Import
import { ChangeDetectionStrategy, Component, signal } from "@angular/core";
import { t6LineChartFixture } from "@grassroot/demo-fixtures";
import { GrassrootLineChart } from "@grassroot/charts-angular";
import type { CurveKind } from "@grassroot/charts-angular";
Props
Prop
Type
Default
Requirement
rendererChartRenderer—
optional
gpuBackendChartGpuBackend—
optional
rendererStrategyPartial<ChartRendererStrategy>—
optional
renderPlanMode"svg" | "host""host"optional
ariaLabelstring—
optional
titlestring—
optional
descriptionstring—
optional
themePartialChartTheme—
optional
animationChartAnimationInput—
optional
interactivebooleantrueoptional
tooltipboolean | TooltipBehaviorConfigtrueoptional
legendboolean | LegendConfig—
optional
- Prop
renderer- Type
ChartRenderer- Default
- —
- Requirement
- optional
- Prop
gpuBackend- Type
ChartGpuBackend- Default
- —
- Requirement
- optional
- Prop
rendererStrategy- Type
Partial<ChartRendererStrategy>- Default
- —
- Requirement
- optional
- Prop
renderPlanMode- Type
"svg" | "host"- Default
"host"- Requirement
- optional
- Prop
ariaLabel- Type
string- Default
- —
- Requirement
- optional
- Prop
title- Type
string- Default
- —
- Requirement
- optional
- Prop
description- Type
string- Default
- —
- Requirement
- optional
- Prop
theme- Type
PartialChartTheme- Default
- —
- Requirement
- optional
- Prop
animation- Type
ChartAnimationInput- Default
- —
- Requirement
- optional
- Prop
interactive- Type
boolean- Default
true- Requirement
- optional
- Prop
keyboardNavigation- Type
boolean- Default
true- Requirement
- optional
- Prop
tooltip- Type
boolean | TooltipBehaviorConfig- Default
true- Requirement
- optional
- Prop
legend- Type
boolean | LegendConfig- Default
- —
- Requirement
- optional
- Prop
hiddenSeries- Type
readonly string[]- Default
- —
- Requirement
- optional
- Prop
defaultHiddenSeries- Type
readonly string[]- Default
[]- Requirement
- optional
- Prop
activeDatum- Type
string | null- Default
- —
- Requirement
- optional
- Prop
defaultActiveDatum- Type
string | null- Default
null- Requirement
- optional
- Prop
speed- Type
number- Default
- —
- Requirement
- optional
- Prop
morphDurationMs- Type
number- Default
- —
- Requirement
- optional
- Prop
replayToken- Type
string | number- Default
- —
- Requirement
- optional
- Prop
series- Type
readonly ChartSeries[]- Default
- —
- Requirement
- required
- Prop
max- Type
number- Default
- —
- Requirement
- optional
- Prop
xDomain- Type
LineChartOptions["xDomain"]- Default
- —
- Requirement
- optional
- Prop
xScale- Type
LineChartOptions["xScale"]- Default
- —
- Requirement
- optional
- Prop
yDomain- Type
LineChartOptions["yDomain"]- Default
- —
- Requirement
- optional
- Prop
xAxis- Type
LineChartOptions["xAxis"]- Default
- —
- Requirement
- optional
- Prop
yAxis- Type
LineChartOptions["yAxis"]- Default
- —
- Requirement
- optional
- Prop
showGrid- Type
boolean- Default
false- Requirement
- optional
- Prop
curve- Type
CurveKind | undefined- Default
undefined- Requirement
- optional
- Prop
live- Type
boolean- Default
false- Requirement
- optional
- Prop
formatXTick- Type
LineChartOptions["formatXTick"]- Default
- —
- Requirement
- optional
- Prop
formatYTick- Type
LineChartOptions["formatYTick"]- Default
- —
- Requirement
- optional
- Prop
formatXValue- Type
LineChartOptions["formatXValue"]- Default
- —
- Requirement
- optional
- Prop
formatYValue- Type
LineChartOptions["formatYValue"]- Default
- —
- Requirement
- optional
- Prop
locale- Type
LineChartOptions["locale"]- Default
- —
- Requirement
- optional
- Prop
timeZone- Type
LineChartOptions["timeZone"]- Default
- —
- Requirement
- optional
- Prop
invalidData- Type
LineChartOptions["invalidData"]- Default
- —
- Requirement
- optional
- Prop
referenceLines- Type
readonly ReferenceLine[]- Default
- —
- Requirement
- optional
- Prop
referenceBands- Type
readonly ReferenceBand[]- Default
- —
- Requirement
- optional
- Prop
selectionMode- Type
SelectionMode- Default
"none"- Requirement
- optional
- Prop
selectedIds- Type
SelectionValue- Default
- —
- Requirement
- optional
- Prop
defaultSelectedIds- Type
SelectionValue- Default
- —
- Requirement
- optional
- Prop
onSelectedIdsChange- Type
(ids: SelectionValue) => void- Default
- —
- Requirement
- optional
- Prop
brushDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
defaultBrushDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
onBrushDomainChange- Type
(domain: ChartXDomain) => void- Default
- —
- Requirement
- optional
- Prop
zoomDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
defaultZoomDomain- Type
ChartXDomain- Default
null- Requirement
- optional
- Prop
onZoomDomainChange- Type
(domain: ChartXDomain) => void- Default
- —
- Requirement
- optional
- Prop
zoomOnBrush- Type
boolean- Default
false- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
- Prop
crosshair- Type
boolean | CrosshairBehaviorConfig- Default
true- Requirement
- optional
- Prop
activePoint- Type
ActivePoint<ChartXYDatum> | null- Default
- —
- Requirement
- optional
- Prop
defaultActivePoint- Type
ActivePoint<ChartXYDatum> | null- Default
null- Requirement
- optional
Events
| Event | Payload |
|---|---|
activeDatumChange | string | null |
hiddenSeriesChange | readonly string[] |
selectedIdsChange | readonly string[] |
brushDomainChange | ChartXDomain |
zoomDomainChange | ChartXDomain |
activePointChange | ActivePoint<ChartXYDatum> | null |
Content regions
dataSummarydefault
Import
import { t6LineChartFixture } from "@grassroot/demo-fixtures";
import { LineChart } from "@grassroot/charts-svelte";
import type { CurveKind } from "@grassroot/charts-svelte";
Props
Prop
Type
Default
Requirement
seriesreadonly ChartSeries[]—
required
maxnumber—
optional
xDomainLineChartOptions["xDomain"]—
optional
xScaleLineChartOptions["xScale"]—
optional
yDomainLineChartOptions["yDomain"]—
optional
xAxisLineChartOptions["xAxis"]—
optional
yAxisLineChartOptions["yAxis"]—
optional
showGridbooleanfalseoptional
curveCurveKind—
optional
livebooleanfalseoptional
formatXTickLineChartOptions["formatXTick"]—
optional
formatYTickLineChartOptions["formatYTick"]—
optional
formatXValueLineChartOptions["formatXValue"]—
optional
formatYValueLineChartOptions["formatYValue"]—
optional
- Prop
series- Type
readonly ChartSeries[]- Default
- —
- Requirement
- required
- Prop
max- Type
number- Default
- —
- Requirement
- optional
- Prop
xDomain- Type
LineChartOptions["xDomain"]- Default
- —
- Requirement
- optional
- Prop
xScale- Type
LineChartOptions["xScale"]- Default
- —
- Requirement
- optional
- Prop
yDomain- Type
LineChartOptions["yDomain"]- Default
- —
- Requirement
- optional
- Prop
xAxis- Type
LineChartOptions["xAxis"]- Default
- —
- Requirement
- optional
- Prop
yAxis- Type
LineChartOptions["yAxis"]- Default
- —
- Requirement
- optional
- Prop
showGrid- Type
boolean- Default
false- Requirement
- optional
- Prop
curve- Type
CurveKind- Default
- —
- Requirement
- optional
- Prop
live- Type
boolean- Default
false- Requirement
- optional
- Prop
formatXTick- Type
LineChartOptions["formatXTick"]- Default
- —
- Requirement
- optional
- Prop
formatYTick- Type
LineChartOptions["formatYTick"]- Default
- —
- Requirement
- optional
- Prop
formatXValue- Type
LineChartOptions["formatXValue"]- Default
- —
- Requirement
- optional
- Prop
formatYValue- Type
LineChartOptions["formatYValue"]- Default
- —
- Requirement
- optional
- Prop
locale- Type
LineChartOptions["locale"]- Default
- —
- Requirement
- optional
- Prop
timeZone- Type
LineChartOptions["timeZone"]- Default
- —
- Requirement
- optional
- Prop
invalidData- Type
LineChartOptions["invalidData"]- Default
- —
- Requirement
- optional
- Prop
referenceLines- Type
readonly ReferenceLine[]- Default
- —
- Requirement
- optional
- Prop
referenceBands- Type
readonly ReferenceBand[]- Default
- —
- Requirement
- optional
- Prop
selectionMode- Type
SelectionMode- Default
"none"- Requirement
- optional
- Prop
selectedIds- Type
SelectionValue- Default
- —
- Requirement
- optional
- Prop
defaultSelectedIds- Type
SelectionValue- Default
- —
- Requirement
- optional
- Prop
onSelectedIdsChange- Type
(ids: SelectionValue) => void- Default
- —
- Requirement
- optional
- Prop
brushDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
defaultBrushDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
onBrushDomainChange- Type
(domain: ChartXDomain) => void- Default
- —
- Requirement
- optional
- Prop
zoomDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
defaultZoomDomain- Type
ChartXDomain- Default
null- Requirement
- optional
- Prop
onZoomDomainChange- Type
(domain: ChartXDomain) => void- Default
- —
- Requirement
- optional
- Prop
zoomOnBrush- Type
boolean- Default
false- Requirement
- optional
- Prop
renderer- Type
ChartRenderer- Default
- —
- Requirement
- optional
- Prop
ariaLabel- Type
string- Default
- —
- Requirement
- optional
- Prop
title- Type
string- Default
- —
- Requirement
- optional
- Prop
description- Type
string- Default
- —
- Requirement
- optional
- Prop
keyboardNavigation- Type
boolean- Default
true- Requirement
- optional
- Prop
interactive- Type
boolean- Default
true- Requirement
- optional
- Prop
crosshair- Type
boolean | CrosshairBehaviorConfig- Default
true- Requirement
- optional
- Prop
tooltip- Type
boolean | TooltipBehaviorConfig- Default
true- Requirement
- optional
- Prop
legend- Type
boolean | LegendConfig- Default
false- Requirement
- optional
- Prop
activePoint- Type
ActivePoint<ChartXYDatum> | null- Default
- —
- Requirement
- optional
- Prop
defaultActivePoint- Type
ActivePoint<ChartXYDatum> | null- Default
null- Requirement
- optional
- Prop
onActivePointChange- Type
(point: ActivePoint<ChartXYDatum> | null) => void- Default
- —
- Requirement
- optional
- Prop
hiddenSeries- Type
readonly string[]- Default
- —
- Requirement
- optional
- Prop
defaultHiddenSeries- Type
readonly string[]- Default
- —
- Requirement
- optional
- Prop
onHiddenSeriesChange- Type
(ids: readonly string[]) => void- Default
- —
- Requirement
- optional
- Prop
theme- Type
PartialChartTheme- Default
- —
- Requirement
- optional
- Prop
animation- Type
ChartAnimationInput- Default
- —
- Requirement
- optional
- Prop
class- Type
string- Default
- —
- Requirement
- optional
- Prop
style- Type
string- Default
- —
- Requirement
- optional
- Prop
speed- Type
number- Default
- —
- Requirement
- optional
- Prop
morphDurationMs- Type
number- Default
- —
- Requirement
- optional
- Prop
replayToken- Type
string | number- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onSelectedIdsChange | (ids: SelectionValue) => void |
onBrushDomainChange | (domain: ChartXDomain) => void |
onZoomDomainChange | (domain: ChartXDomain) => void |
onActivePointChange | (point: ActivePoint<ChartXYDatum> | null) => void |
onHiddenSeriesChange | (ids: readonly string[]) => void |
Content regions
childrendataSummary
Import
import { For, createSignal, type ComponentProps } from "solid-js";
import { t6LineChartFixture } from "@grassroot/demo-fixtures";
import { LineChart } from "@grassroot/charts-solid";
import type { CurveKind } from "@grassroot/charts-solid";
Props
Prop
Type
Default
Requirement
seriesreadonly ChartSeries[]—
required
maxnumber—
optional
xDomainLineChartOptions["xDomain"]—
optional
xScaleLineChartOptions["xScale"]—
optional
yDomainLineChartOptions["yDomain"]—
optional
xAxisLineChartOptions["xAxis"]—
optional
yAxisLineChartOptions["yAxis"]—
optional
showGridbooleanfalseoptional
curveCurveKind—
optional
liveboolean—
optional
formatXTickLineChartOptions["formatXTick"]—
optional
formatYTickLineChartOptions["formatYTick"]—
optional
formatXValueLineChartOptions["formatXValue"]—
optional
formatYValueLineChartOptions["formatYValue"]—
optional
- Prop
series- Type
readonly ChartSeries[]- Default
- —
- Requirement
- required
- Prop
max- Type
number- Default
- —
- Requirement
- optional
- Prop
xDomain- Type
LineChartOptions["xDomain"]- Default
- —
- Requirement
- optional
- Prop
xScale- Type
LineChartOptions["xScale"]- Default
- —
- Requirement
- optional
- Prop
yDomain- Type
LineChartOptions["yDomain"]- Default
- —
- Requirement
- optional
- Prop
xAxis- Type
LineChartOptions["xAxis"]- Default
- —
- Requirement
- optional
- Prop
yAxis- Type
LineChartOptions["yAxis"]- Default
- —
- Requirement
- optional
- Prop
showGrid- Type
boolean- Default
false- Requirement
- optional
- Prop
curve- Type
CurveKind- Default
- —
- Requirement
- optional
- Prop
live- Type
boolean- Default
- —
- Requirement
- optional
- Prop
formatXTick- Type
LineChartOptions["formatXTick"]- Default
- —
- Requirement
- optional
- Prop
formatYTick- Type
LineChartOptions["formatYTick"]- Default
- —
- Requirement
- optional
- Prop
formatXValue- Type
LineChartOptions["formatXValue"]- Default
- —
- Requirement
- optional
- Prop
formatYValue- Type
LineChartOptions["formatYValue"]- Default
- —
- Requirement
- optional
- Prop
locale- Type
LineChartOptions["locale"]- Default
- —
- Requirement
- optional
- Prop
timeZone- Type
LineChartOptions["timeZone"]- Default
- —
- Requirement
- optional
- Prop
invalidData- Type
LineChartOptions["invalidData"]- Default
- —
- Requirement
- optional
- Prop
referenceLines- Type
LineChartOptions["referenceLines"]- Default
- —
- Requirement
- optional
- Prop
referenceBands- Type
LineChartOptions["referenceBands"]- Default
- —
- Requirement
- optional
- Prop
renderer- Type
ChartRenderer- Default
- —
- Requirement
- optional
- Prop
ariaLabel- Type
string- Default
- —
- Requirement
- optional
- Prop
interactive- Type
boolean- Default
- —
- Requirement
- optional
- Prop
crosshair- Type
boolean | CrosshairBehaviorConfig- Default
true- Requirement
- optional
- Prop
tooltip- Type
boolean | TooltipBehaviorConfig- Default
- —
- Requirement
- optional
- Prop
legend- Type
boolean | LegendConfig- Default
- —
- Requirement
- optional
- Prop
activePoint- Type
ActivePoint<ChartXYDatum> | null- Default
- —
- Requirement
- optional
- Prop
defaultActivePoint- Type
ActivePoint<ChartXYDatum> | null- Default
null- Requirement
- optional
- Prop
onActivePointChange- Type
(point: ActivePoint<ChartXYDatum> | null) => void- Default
- —
- Requirement
- optional
- Prop
hiddenSeries- Type
readonly string[]- Default
- —
- Requirement
- optional
- Prop
defaultHiddenSeries- Type
readonly string[]- Default
- —
- Requirement
- optional
- Prop
onHiddenSeriesChange- Type
(ids: readonly string[]) => void- Default
- —
- Requirement
- optional
- Prop
selectionMode- Type
SelectionMode- Default
- —
- Requirement
- optional
- Prop
selectedIds- Type
readonly string[]- Default
- —
- Requirement
- optional
- Prop
defaultSelectedIds- Type
readonly string[]- Default
- —
- Requirement
- optional
- Prop
onSelectedIdsChange- Type
(ids: readonly string[]) => void- Default
- —
- Requirement
- optional
- Prop
brushDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
defaultBrushDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
onBrushDomainChange- Type
(domain: ChartXDomain) => void- Default
- —
- Requirement
- optional
- Prop
zoomDomain- Type
ChartXDomain- Default
- —
- Requirement
- optional
- Prop
defaultZoomDomain- Type
ChartXDomain- Default
null- Requirement
- optional
- Prop
onZoomDomainChange- Type
(domain: ChartXDomain) => void- Default
- —
- Requirement
- optional
- Prop
zoomOnBrush- Type
boolean- Default
- —
- Requirement
- optional
- Prop
title- Type
string- Default
- —
- Requirement
- optional
- Prop
description- Type
string- Default
- —
- Requirement
- optional
- Prop
keyboardNavigation- Type
boolean- Default
- —
- Requirement
- optional
- Prop
theme- Type
PartialChartTheme- Default
- —
- Requirement
- optional
- Prop
animation- Type
ChartAnimationInput- Default
- —
- Requirement
- optional
- Prop
speed- Type
number- Default
- —
- Requirement
- optional
- Prop
morphDurationMs- Type
number- Default
- —
- Requirement
- optional
- Prop
replayToken- Type
string | number- Default
- —
- Requirement
- optional
- Prop
class- Type
string- Default
- —
- Requirement
- optional
- Prop
style- Type
JSX.CSSProperties- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onActivePointChange | (point: ActivePoint<ChartXYDatum> | null) => void |
onHiddenSeriesChange | (ids: readonly string[]) => void |
onSelectedIdsChange | (ids: readonly string[]) => void |
onBrushDomainChange | (domain: ChartXDomain) => void |
onZoomDomainChange | (domain: ChartXDomain) => void |
Content regions
childrendataSummary