Components
BaseChart
Area, line, bar, donut, pie and radial charts on Apache ECharts, coloured by the theme.
components/ui/chart/BaseChart.vue
View in the demo
Types
Switch the type, then switch the example to dark mode: the colours follow the theme.
Stacked, horizontal, markers and options
The Charts guide explains colours, formats, the escape hatch and how ECharts is loaded.
API
Props
Name | Type | Default | Description |
|---|---|---|---|
type | ChartType | "line" | area, line, bar, donut, pie or radial. |
stacked | boolean | false | Stacks bars or areas. |
horizontal | boolean | false | Horizontal bars. |
markers | boolean | false | A dot on every point of lines and areas. |
legend | boolean | — | Forces the legend on or off; by default it shows with several series. |
value-format | ChartValueFormatter | — | Formats axis labels and tooltips. |
height | string | number | DEFAULT_HEIGHT | Height in pixels or a CSS length. |
aria-label | string | — | Describes the chart for screen readers. |
options | ChartOptions | {} | An ECharts option deep-merged on top. |
loading | boolean | false | Shows the skeleton. |
series | ChartSeriesInput | [] | [{ name?, data }], or a plain array for one series. |
categories | (string | number)[] | [] | X-axis labels, or slice names for donut, pie and radial. |