HTML Charts
HTML Charts / Distribution
Free Chart.js chart for HTML containers

Distribution

A histogram of one value per row (e.g. per customer or order), with median, mean, P10–P90 and how much the top 10% hold – optionally split into groups.

v1.1.0Live demo · random data1 metric0–1 dimensionsDistribution
Live demo – the chart is reading the random grid underneath, exactly as it reads a real one
Demo grid · … rows of random valuesIn use this is your grid, tucked behind the chart

When to use it

Use it when you have one value per row – per customer, order or day – and averages hide what's really going on.

Questions it answers

How to use it

  1. On your dashboard page, add a grid with the columns below (or map your own header names – see below). Keep it on the same page – tuck it behind the chart rather than hiding it, and make it tall.
  2. Add an HTML container (one that runs JavaScript) and paste the snippet.
  3. View the page. The chart finds the grid, reads every row and draws itself; it updates when filters change the grid.
Default headerKeyWhat it's for
Metric 1v1RequiredOne value per grid row.
Dimension AdimAOptionalOptional group – up to 4 groups overlaid as % of each group.
Snippet for the HTML container
<div data-chart-embed="distribution" style="height:100%"></div>
<script>
(function () {
  var s = document.createElement("script");
  s.src = "https://viz.kaijxnes.com/charts/distribution-1.1.0.js";
  s.integrity = "sha384-Vv89kqJwYHMqrbVNgT4kFp3dThQwUHGQfaSp0nucyyb5wsP0b0sx3Fd8tjs8A2SK";
  s.crossOrigin = "anonymous";
  document.head.appendChild(s);
})();
</script>
Script URL
https://viz.kaijxnes.com/charts/distribution-1.1.0.js
Integrity (SRI)
sha384-Vv89kqJwYHMqrbVNgT4kFp3dThQwUHGQfaSp0nucyyb5wsP0b0sx3Fd8tjs8A2SK
Chart.js
https://viz.kaijxnes.com/chart.umd-4.4.1.js · sha384-dug+JxfBvklEQdJ4AYuBBAIScUz0bVN73xpy273gcAwHjb3qI0fXmuYNaNfdyYJG
The integrity value pins this exact version: the browser refuses to run the script if a single byte changes. New versions get a new file name and a new snippet, so a dashboard only changes when you paste the new snippet.

Your own column names

The chart looks for the default headers above. If your grid's headers are different, map them by key with data-columns on the placeholder – the chart then shows your names too. data-labels (same keys) changes just the on-screen names, and data-title changes the heading. For grids that draw rows in batches, data-grid-class and data-scroll-class name the grid's container and its scroll box so every row is read.

Example
<div data-chart-embed="distribution" data-columns='{"month":"Your Month Header","dimA":"Your Metric Header"}' data-title="Your title" style="height:100%"></div>
<script>
(function () {
  var s = document.createElement("script");
  s.src = "https://viz.kaijxnes.com/charts/distribution-1.1.0.js";
  s.integrity = "sha384-Vv89kqJwYHMqrbVNgT4kFp3dThQwUHGQfaSp0nucyyb5wsP0b0sx3Fd8tjs8A2SK";
  s.crossOrigin = "anonymous";
  document.head.appendChild(s);
})();
</script>

What it does

Data & security

More charts

Monthly BarsBar + line, Metric toggle, AveragesStacked SegmentsStacked bars, Segments, Filters, Large gridsSegment BreakdownStacked bars, Segments, Large gridsCost vs ReturnKPIs, ROI, Cost per unitMonth HeatmapHeatmap, Curves, Large gridsKPI ScorecardKPI cards, Sparklines, ComparisonsTime Series TrioTime series, Scorecards, Date rangesFunnelFunnel, Conversion, SegmentsChange BridgeWaterfall, Variance, DriversParetoRanking, 80/20, CumulativeTarget PacingTargets, Projection, DailyQuadrant ScatterScatter, Bubbles, QuadrantsMix ShiftShare, 100% stacked, TrendsCalendar HeatmapCalendar, Daily, Weekday patternsYear over YearYoY, Year to date, SeasonalityLeaderboardRanking, Table, SparklinesTarget AttainmentTargets, Bullet bars, RankingAnomaly WatchAnomalies, Rolling average, AlertsTreemapTreemap, Hierarchy, ShareSmall MultiplesSmall multiples, Trends, SegmentsVariance TableTable, Variance, Month vs monthGaugesGauges, Targets, KPIsCombo ChartBar + line, Dual axis, Time seriesFlow (Sankey)Sankey, Flows, Two dimensionsBox PlotBox plot, Spread, GroupsRadar CompareRadar, Profiles, Many metricsBump ChartRanks, Over time, MoversIndexed GrowthGrowth, Index, Over timeDumbbellBefore / after, Change, RankingCorrelation MatrixCorrelation, Many metrics, ScatterTime Series StackTime series, Scorecards, Up to 6 metricsTime Series – 1 metricTime series, Scorecard, 1 metricTime Series – 2 metricsTime series, Scorecards, 2 metricsKPI Scorecard – 3 metricsKPI cards, Sparklines, 3 metricsCombo Chart – bar + lineBar + line, Dual axis, 2 metricsVariance Table – 1 metricTable, Variance, 1 metricFunnel – no segmentsFunnel, Conversion, 0 dimensionsTreemap – one levelTreemap, Share, 1 dimensionQuadrant Scatter – 2 metricsScatter, Quadrants, 2 metricsRadar Compare – 4 metricsRadar, Profiles, 4 metrics
Made by – data analyst building custom visuals for reporting. See my CV