Features · legend

Legend item styling

native

Marker shape, size, font, spacing

Matrix status native. Verification types · strong. ChartKit option: ChartKitChartSpecV1.legend.symbol.

symbol and per-series symbols.

Source: chartkit:packages/core/src/generated/schema.ts:215

ChartKit spec

Passed validate() during npm run matrix:refresh. The SVG is the server render.

Units rose in Q2.Units rose in Q2.40455055Q1Q2
{
  "version": "1",
  "type": "line",
  "data": [
    {
      "quarter": "Q1",
      "units": 40
    },
    {
      "quarter": "Q2",
      "units": 55
    }
  ],
  "encoding": {
    "x": "quarter",
    "y": "units"
  },
  "a11y": {
    "alt": "Units rose in Q2."
  },
  "size": {
    "width": 640,
    "height": 260
  },
  "legend": {
    "symbol": "circle"
  }
}

Other libraries

Option names are the paths recorded in the matrix. A grep-only cell names the identifier that matched, not a render test. Markdown copy: legend.style.md.

LibraryStatusOptionVerificationSource
Chart.jsnativegrep: boxWidthgrep · weakchart.js/dist/types/index.d.ts:2354
RechartsnativeLegend.iconType, Legend.iconSizetypes · strongrecharts/types/component/DefaultLegendContent.d.ts:35
Apache EChartsnativelegend.itemWidth, legend.icontypes · strongecharts/types/dist/shared.d.ts:4365
Highchartsnativelegend.itemStyle, legend.symbolRadiustypes · stronghighcharts/highcharts.d.ts:13500
Plotly.jsnativelayout.legend.font, layout.legend.itemsizingtypes · strongplot-schema.json#layout.layoutAttributes.legend.font
Nivonativegrep: symbolShapegrep · weak@nivo/legends/dist/types/types.d.ts:15
VictorynativeVictoryLegend.symbolSpacer, VictoryLegend.styletypes · strongvictory-legend/lib/victory-legend.d.ts:23
visxnativeLegendOrdinal.shape, LegendOrdinal.shapeWidthtypes · strong@visx/legend/lib/legends/Legend/index.d.ts:39
ApexChartsnativelegend.markers.size, legend.fontSizetypes · strongapexcharts/types/apexcharts.d.ts:4617
Tremor (npm)none—absence · absence—
Observable Plotnativegrep: swatchSizegrep · weak@observablehq/plot/src/legends.d.ts:117
Vega-Litenativegrep: symbolTypegrep · weak1381: "labelFontSize"
AG Chartsnativegrep: markergrep · weakag-charts-types/dist/types/src/main.d.ts:86
amCharts 5nativegrep: markerRectanglesgrep · weak@amcharts/amcharts5/.internal/core/render/Legend.d.ts:118
Google Chartsnativegrep: textStylegrep · weak@types/google.visualization/index.d.ts:404
uPlotpartialOptions.legend.markerstypes · stronguplot/dist/uPlot.d.ts:283
TradingView Lightweight Chartsnone—absence · absence—
MUI X Chartsunknowngrep: markGapunverified · unknown—
Mermaid (chart-ish diagrams only)none—absence · absence—
AntV G2nativegrep: itemMarkergrep · weak@antv/g2/lib/theme/create.d.ts:305