ChartToolbar
Chart header bar — title + legend toggles + zoom / export / refresh buttons.
Basic usage
Data is passed in via props and rendered as plain SVG — no third-party charting library.
Colors come from the --viz-1..8 tokens and are color-blind friendly.
Demo source
<CfChartToolbar ... /> <CfChartToolbar ... /> Live interaction
Click a legend chip to toggle a series; the LineChart below redraws in real time.
Demo source
<CfChartToolbar :series="series" @series-toggle="toggle" />
<CfLineChart :series="visibleSeries" /> <CfChartToolbar series={series} onSeriesToggle={toggle} />
<CfLineChart series={visibleSeries} /> API
| Prop | Type | Default | Description |
|---|---|---|---|
title / subtitle | string | — | Title and description |
series | LegendSeries[] | — | { name, colorIndex, hidden? }[]; clicking a legend item triggers toggle |
showZoom / showExport / showRefresh | boolean | false | Show button slots |
反馈与讨论
ChartToolbar · Discussion