Custom tooltip fields
native
Add extra data fields or reorder tooltip rows
Matrix status native. Verification runtime · strong. ChartKit option: ChartKitChartSpecV1.tooltip.fields.
A string is a field name. An object sets title and format. The interaction runtime draws those rows in that order.
Source: packages/core/src/interact.ts
ChartKit spec
Passed validate() during npm run matrix:refresh. The SVG is the server render.
{
"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
},
"tooltip": {
"fields": [
"units"
]
}
}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: tooltip.fields.md.
| Library | Status | Option | Verification | Source |
|---|---|---|---|---|
| Chart.js | native | grep: callbacks | grep · weak | chart.js/dist/types/index.d.ts:2681 |
| Recharts | partial | Tooltip.content | types · strong | recharts/types/component/Tooltip.d.ts:65 |
| Apache ECharts | native | tooltip.formatter, series.encode | types · strong | echarts/types/dist/shared.d.ts:8072 |
| Highcharts | native | tooltip.pointFormat{point.custom} | types · strong | highcharts/highcharts.d.ts:107468 |
| Plotly.js | native | trace.customdata, trace.hovertemplate | types · strong | plot-schema.json#traces.{bar,barpolar,box,candlestick,carpet,choropleth,…}.attributes.customdata |
| Nivo | partial | Line.tooltip | types · strong | @nivo/line/dist/types/types.d.ts:165 |
| Victory | partial | VictoryTooltip | types · strong | victory-tooltip/lib/victory-tooltip.d.ts:66 |
| visx | manual | Group | mechanism · weak | @visx/group/lib/Group.d.ts:15 |
| ApexCharts | native | tooltip.custom | types · strong | apexcharts/types/apexcharts.d.ts:4852 |
| Tremor (npm) | partial | LineChart.customTooltip | types · strong | @tremor/react/dist/index.d.ts:80 |
| Observable Plot | native | grep: channelsextra channels shown in tip | grep · weak | @observablehq/plot/src/scales.d.ts:370 |
| Vega-Lite | native | grep: tooltiparray of field defs | grep · weak | 630: "description" |
| AG Charts | native | grep: renderer | grep · weak | ag-charts-types/dist/types/src/presets/sparkline/sparklineOptions.d.ts:1 |
| amCharts 5 | native | grep: labelText | grep · weak | @amcharts/amcharts5/.internal/charts/xy/series/XYSeries.d.ts:490 |
| Google Charts | native | grep: tooltiptooltip role column | grep · weak | @types/google.visualization/index.d.ts:386 |
| uPlot | manual | Options.hooks | mechanism · weak | uplot/dist/uPlot.d.ts:394 |
| TradingView Lightweight Charts | none | — | absence · absence | — |
| MUI X Charts | native | grep: valueFormatter | grep · weak | @mui/x-charts/SparkLineChart/SparkLineChart.d.ts:43 |
| Mermaid (chart-ish diagrams only) | unknown | — | conflict · unknown | — |
| AntV G2 | native | grep: items | grep · weak | @antv/g2/lib/component/utils.d.ts:14 |