Grouped Stacked Column Chart - CanvasJS JavaScript Charts
Grouped Stacked Column Chart - CanvasJS JavaScript Charts
by canvasjs
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",{
axisY2: {
lineThickness: 0,
tickLength: 0,
labelFormatter: function(e){
return "";
}
},
data: [
{
type: "stackedColumn",
color: "#FF8027",
dataPoints: [
{ label: "Fall 2014", y: 1 }
]
},
{
type: "stackedColumn",
color: "#23B14D",
dataPoints: [
{ label: "Fall 2014", y: 0.7 }
]
},
{
type: "stackedColumn",
axisYType: "secondary",
color: "#B87956",
dataPoints: [
{ label: "Fall 2014", y: 0.7 }
]
},
{
type: "stackedColumn",
axisYType: "secondary",
color: "#23B14D",
dataPoints: [
{ label: "Fall 2014", y: 1 }
]
}
]
});
chart.render();
chart.axisY2[0].set("maximum", chart.axisY[0].get("maximum"))