Chart API
import { Chart } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
ariaLabel | string | |
data | ChartPoint[] | |
disabled | boolean | |
headingLevel | 1 | 2 | 3 | 4 | 5 | 6 | The title's heading level (default 3), to fit the page's outline. |
headless | boolean | |
interactive | boolean | |
labels | string[] | |
locale | string | Locale for numbers (en-IN gives 1,00,000). Defaults to the nearest lang attribute, then the browser. |
onPointSelect | (detail: ChartPointSelectDetail) => void | |
series | ChartSeries[] | |
showChange | boolean | false for categories (stages, devices) rather than a sequence: shows the lowest value instead of a first-to-last change. |
showInsight | boolean | The one-line readout under the plot (range and change, or the selected point). Defaults to showSummary. |
showLegend | boolean | |
showSummary | boolean | The Total / Average / Peak / Change row, and (unless showInsight says otherwise) the readout line under the plot. |
showTable | boolean | Show the chart's numbers as a table below it (always available to screen readers). |
state | ChartState | |
subtitle | string | |
title | string | |
type | 'line' | 'area' | 'bar' | 'donut' | 'step' | 'scatter' | 'radial' | |
valuePrefix | string | |
values | number[] | |
valueSuffix | string | |
variant | 'default' | 'contrast' | 'minimal' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Chart.Root props
| Prop | Type | Description |
|---|---|---|
ariaLabel | string | |
data | ChartPoint[] | |
disabled | boolean | |
headingLevel | 1 | 2 | 3 | 4 | 5 | 6 | The title's heading level (default 3), to fit the page's outline. |
headless | boolean | |
interactive | boolean | |
labels | string[] | |
locale | string | Locale for numbers (en-IN gives 1,00,000). Defaults to the nearest lang attribute, then the browser. |
onPointSelect | (detail: ChartPointSelectDetail) => void | |
series | ChartSeries[] | |
showChange | boolean | false for categories (stages, devices) rather than a sequence: shows the lowest value instead of a first-to-last change. |
showInsight | boolean | The one-line readout under the plot (range and change, or the selected point). Defaults to showSummary. |
showLegend | boolean | |
showSummary | boolean | The Total / Average / Peak / Change row, and (unless showInsight says otherwise) the readout line under the plot. |
showTable | boolean | Show the chart's numbers as a table below it (always available to screen readers). |
state | ChartState | |
subtitle | string | |
title | string | |
type | 'line' | 'area' | 'bar' | 'donut' | 'step' | 'scatter' | 'radial' | |
valuePrefix | string | |
values | number[] | |
valueSuffix | string | |
variant | 'default' | 'contrast' | 'minimal' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Chart.Header props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Chart.Title props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Chart.Subtitle props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-chart>
Chart renders the ui-chart custom element from @editora/ui-core, which can also be used without React.
Attributes: aria-label, data, disabled, heading-level, headless, interactive, labels, locale, series, show-change, show-insight, show-legend, show-summary, show-table, state, subtitle, title, type, value-prefix, value-suffix, values, variant
Events: point-select, ui-point-select