JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "Chart Title"
},
toolTip: {
shared: true
},
data: [
{
type: "stackedColumn",
name: "Planned",
showInLegend: true,
color: "rgb(119,147,60)",
indexLabel: "{y}",
indexLabelPlacement: "outside",
dataPoints: [
{ label: "Jan", y: 25666 },
{ label: "Feb", y: 28188 },
{ label: "Mar", y: 19341 }
]
},
{
type: "column",
name: "Completed",
showInLegend: true,
color: "rgba(177,194,141,0.8)",
indexLabel: "{y}",
indexLabelPlacement: "inside",
dataPoints: [
{ label: "Jan", y: 21538 },
{ label: "Feb", y: 20520 },
{ label: "Mar", y: 14524 }
]
}
]
});
chart.render();
chart.data[1].set("stemThickness", chart.get("dataPointWidth") / 3);