Preview Updated 2026-05-10

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.

系统资源

last 24h · 1m sampling
  • CPU
  • Memory
图表区
Demo source
src/App.vue vue
<CfChartToolbar ... />
src/App.tsx tsx
<CfChartToolbar ... />

Live interaction

Click a legend chip to toggle a series; the LineChart below redraws in real time.

系统资源

last 10m · live
  • CPU
  • Memory
20355065800123456789
Demo source
src/App.vue vue
<CfChartToolbar :series="series" @series-toggle="toggle" />
<CfLineChart :series="visibleSeries" />
src/App.tsx tsx
<CfChartToolbar series={series} onSeriesToggle={toggle} />
<CfLineChart series={visibleSeries} />

API

PropTypeDefaultDescription
title / subtitlestringTitle and description
seriesLegendSeries[]{ name, colorIndex, hidden? }[]; clicking a legend item triggers toggle
showZoom / showExport / showRefreshbooleanfalseShow button slots

反馈与讨论

ChartToolbar · Discussion

0
0 / 600
一键发送
正在加载评论...