Chartjs-How to show 2 populations types in one bar using chartjs?

1👍

You can use the Stacked Bar Chart – the one linked to from the Community Extensions section of the ChartJS site – http://www.chartjs.org/docs/#advanced-usage-community-extensions

https://github.com/Regaddi/Chart.StackedBar.js

With the library and the extension included, you call it just as you would a normal ChartJS chart.

var ctx = document.getElementById("canvas").getContext("2d");
var myBar = new Chart(ctx).StackedBar(barChartData);

Fiddle – http://jsfiddle.net/42s1naq9/


enter image description here

Leave a comment