Skip to main content
Version: Next

Chart API

import { Chart } from '@editora/ui-react';

Props​

PropTypeDescription
ariaLabelstring
dataChartPoint[]
disabledboolean
headingLevel1 | 2 | 3 | 4 | 5 | 6The title's heading level (default 3), to fit the page's outline.
headlessboolean
interactiveboolean
labelsstring[]
localestringLocale for numbers (en-IN gives 1,00,000). Defaults to the nearest lang attribute, then the browser.
onPointSelect(detail: ChartPointSelectDetail) => void
seriesChartSeries[]
showChangebooleanfalse for categories (stages, devices) rather than a sequence: shows the lowest value instead of a first-to-last change.
showInsightbooleanThe one-line readout under the plot (range and change, or the selected point). Defaults to showSummary.
showLegendboolean
showSummarybooleanThe Total / Average / Peak / Change row, and (unless showInsight says otherwise) the readout line under the plot.
showTablebooleanShow the chart's numbers as a table below it (always available to screen readers).
stateChartState
subtitlestring
titlestring
type'line' | 'area' | 'bar' | 'donut' | 'step' | 'scatter' | 'radial'
valuePrefixstring
valuesnumber[]
valueSuffixstring
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​

PropTypeDescription
ariaLabelstring
dataChartPoint[]
disabledboolean
headingLevel1 | 2 | 3 | 4 | 5 | 6The title's heading level (default 3), to fit the page's outline.
headlessboolean
interactiveboolean
labelsstring[]
localestringLocale for numbers (en-IN gives 1,00,000). Defaults to the nearest lang attribute, then the browser.
onPointSelect(detail: ChartPointSelectDetail) => void
seriesChartSeries[]
showChangebooleanfalse for categories (stages, devices) rather than a sequence: shows the lowest value instead of a first-to-last change.
showInsightbooleanThe one-line readout under the plot (range and change, or the selected point). Defaults to showSummary.
showLegendboolean
showSummarybooleanThe Total / Average / Peak / Change row, and (unless showInsight says otherwise) the readout line under the plot.
showTablebooleanShow the chart's numbers as a table below it (always available to screen readers).
stateChartState
subtitlestring
titlestring
type'line' | 'area' | 'bar' | 'donut' | 'step' | 'scatter' | 'radial'
valuePrefixstring
valuesnumber[]
valueSuffixstring
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​

PropTypeDescription
childrenReact.ReactNode

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Chart.Title props​

PropTypeDescription
childrenReact.ReactNode

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

Chart.Subtitle props​

PropTypeDescription
childrenReact.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