Features · annotation

Trend / average / statistic lines

native

Auto mean, median or regression lines

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

Mean, median, or linear, each with a label.

Source: chartkit:packages/core/src/annotations.ts:19

ChartKit spec

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

Units rose in Q2.Units rose in Q2.Mean40455055Q1Q2
{
  "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
  },
  "annotations": [
    {
      "type": "trendline",
      "method": "mean",
      "label": "Mean"
    }
  ]
}

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: annotation.trendline.md.

LibraryStatusOptionVerificationSource
Chart.jsplugin—(manual value)npm · weak—
RechartspartialScatter.lineType=fittingtypes · strongrecharts/types/cartesian/Scatter.d.ts:126
Apache EChartsnativeseries.markLinetype: 'average' | 'min' | 'max' | 'median'types · strongecharts/types/dist/shared.d.ts:12499
Highchartsnativeseries.type=trendlinetypes · stronghighcharts/options/abands.d.ts:1386
Plotly.jsnone—absence · absence—
Nivounknown—conflict · unknown—
Victoryunknown—conflict · unknown—
visxnone—absence · absence—
ApexChartsnone—absence · absence—
Tremor (npm)none—absence · absence—
Observable PlotnativelinearRegressionYruleY(data, groupZ({y:'mean'}))types · strong@observablehq/plot/src/marks/linearRegression.d.ts:111
Vega-Litenativegrep: regressiongrep · weak5: "Aggregate"
AG Chartsunknown—conflict · unknown—
amCharts 5nativeAverageSeries, RegressionSeriestypes · strong@amcharts/amcharts5/.internal/charts/stock/drawing/AverageSeries.d.ts:8
Google Chartsnativegrep: trendlinesgrep · weak@types/google.visualization/index.d.ts:614
uPlotnone—absence · absence—
TradingView Lightweight Chartsnone—absence · absence—
MUI X Chartsnone—absence · absence—
Mermaid (chart-ish diagrams only)none—absence · absence—
AntV G2nativegrep: meangrep · weak@antv/g2/lib/spec/transform.d.ts:26