Skip to content

Releases

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 04 Dec 20:24
fc3aeb7

Essential Links

Breaking Changes

  • The density dataset type is now histogramDensity. It draws a density curve over a histogram dataset and needs one, and Chart.js chart type ids are shared by every plugin, so the generic density id is left free. The exports follow: HistogramDensityController, HistogramDensityDatasetOptions and HistogramDensityControllerOptions. Options, computeDensity and warning codes are unchanged.
  • Round ticks on the bin axis. The axis still ends on the first and last bin edges, but its ticks are now round values inside that range, such as 140, 150, …, 190 on an axis from 134.7 to 195.5. Before, Chart.js counted the ticks from the first edge and added the last edge as a tick of its own, and the last two labels could be drawn on top of each other. Set ticks.stepSize, ticks.count, bounds: 'ticks' or your own afterBuildTicks to get Chart.js's ticks, or use binEdgeTicks for a tick on every edge.

Bug Fixes

  • Smooth density curves at high pixel ratios. histogramDensity datasets default to cubicInterpolationMode: 'monotone'. As a straight line of 512 points, the curve took Chart.js's fast path, which showed small notches along it on HiDPI screens. The monotone curve never overshoots its points, so it stays at or above zero; set cubicInterpolationMode: 'default' for straight segments.

See the migration guide for the full list of renames.

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 04 Dec 17:31
12bd87e

Essential Links

Enhancements

  • #2 M6 (1.1): density curves and bin selection

Thanks to @adrianbrs and @claude

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 04 Dec 16:32

Essential Links

The first release of chartjs-chart-histogram, a histogram chart type for Chart.js 4.0.1 and later.

Features

  • The histogram chart type. Give it raw values: it bins them and draws each bar on its bin's true edges, on a linear axis.
  • Bins. The sqrt, sturges, rice, scott, fd, doane and auto rules, with numpy's edges, checked against numpy's output on 27 datasets. Also a count, binWidth and binStart, domain, explicit edges, a function, closed: 'right', and maxBins as a safety cap.
  • What the bars show. stat: 'count', 'relative', 'percent' or 'density', forward or reverse cumulative, and weights, given as an array or as a key of object data.
  • Several datasets. Overlays, shared edges with binGroup (stacking works on them), source to bin another dataset's values, pre-binned {x0, x1, y} records, and line datasets on the same axis.
  • Interaction. A 'bin' interaction mode that selects the bin under the pointer, tooltips with range labels ([10, 20), ≤ 20 when cumulative) in the chart's locale, and binEdgeTicks to put ticks on the edges.
  • Events and helpers. onBinsComputed and getBins(), and warnings with codes, each logged once per chart.
  • Headless binning. computeBins() from chartjs-chart-histogram/core, with no Chart.js and no DOM.
  • Packaging. ES modules, CommonJS and a UMD bundle that registers itself, with types for TypeScript 4.7 and later. No runtime dependencies.

Tested with

Chart.js 4.0.1, 4.4.0 and 4.6.2; Node.js 22, 24 and 26; Chromium, Firefox and WebKit; chartjs-plugin-zoom, chartjs-plugin-datalabels and chartjs-plugin-annotation; react-chartjs-2 and vue-chartjs; node-canvas for server-side rendering.