Basic stackedBar100 chart with indexLabel - CanvasJS

Basic stackedBar100 chart with indexLabel - CanvasJS

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: 300px; width: 100%; margin-left:auto; margin-right:auto;"></div>

JavaScript

var chart = new CanvasJS.Chart("chartContainer", { 
    title: {
        text: "Basic stacked bar 100 chart with indexLabels"
    },
    axisX: {
        interval: 1
    },
    data: [
        {
            type: "stackedBar100",
            indexLabel: "{y}",
            indexLabelPlacement: "inside",
            indexLabelFontColor: "black",
            dataPoints: [
                { y: 1 },
                { y: 4 },
                { y: 3 },
                { y: 4 }	
            ]
        },
        {
            type: "stackedBar100",
            indexLabel: "{y}",
            indexLabelPlacement: "inside",
            indexLabelFontColor: "black",
            dataPoints: [
                { y: 1 },
                { y: 4 },
                { y: 3 },
                { y: 4 }	
            ]
        }
    ]
});
chart.render();