Features · tooltip

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.

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
  },
  "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.

LibraryStatusOptionVerificationSource
Chart.jsnativegrep: callbacksgrep · weakchart.js/dist/types/index.d.ts:2681
RechartspartialTooltip.contenttypes · strongrecharts/types/component/Tooltip.d.ts:65
Apache EChartsnativetooltip.formatter, series.encodetypes · strongecharts/types/dist/shared.d.ts:8072
Highchartsnativetooltip.pointFormat{point.custom}types · stronghighcharts/highcharts.d.ts:107468
Plotly.jsnativetrace.customdata, trace.hovertemplatetypes · strongplot-schema.json#traces.{bar,barpolar,box,candlestick,carpet,choropleth,…}.attributes.customdata
NivopartialLine.tooltiptypes · strong@nivo/line/dist/types/types.d.ts:165
VictorypartialVictoryTooltiptypes · strongvictory-tooltip/lib/victory-tooltip.d.ts:66
visxmanualGroupmechanism · weak@visx/group/lib/Group.d.ts:15
ApexChartsnativetooltip.customtypes · strongapexcharts/types/apexcharts.d.ts:4852
Tremor (npm)partialLineChart.customTooltiptypes · strong@tremor/react/dist/index.d.ts:80
Observable Plotnativegrep: channelsextra channels shown in tipgrep · weak@observablehq/plot/src/scales.d.ts:370
Vega-Litenativegrep: tooltiparray of field defsgrep · weak630: "description"
AG Chartsnativegrep: renderergrep · weakag-charts-types/dist/types/src/presets/sparkline/sparklineOptions.d.ts:1
amCharts 5nativegrep: labelTextgrep · weak@amcharts/amcharts5/.internal/charts/xy/series/XYSeries.d.ts:490
Google Chartsnativegrep: tooltiptooltip role columngrep · weak@types/google.visualization/index.d.ts:386
uPlotmanualOptions.hooksmechanism · weakuplot/dist/uPlot.d.ts:394
TradingView Lightweight Chartsnone—absence · absence—
MUI X Chartsnativegrep: valueFormattergrep · weak@mui/x-charts/SparkLineChart/SparkLineChart.d.ts:43
Mermaid (chart-ish diagrams only)unknown—conflict · unknown—
AntV G2nativegrep: itemsgrep · weak@antv/g2/lib/component/utils.d.ts:14