ChartJS - Donut charts with multiple rings

Soni Ali picture Soni Ali · Mar 25, 2015 · Viewed 15.3k times · Source

Is it possible to create a donut chart with multiple rings using ChartJS as shown below?

multi series donut chart

Answer

Varun Mittal picture Varun Mittal · Nov 17, 2015

You can find out the solution at fiddle link

var ctx = document.getElementById("chart-area").getContext("2d");
var myDoughnut = new Chart(ctx, config);
var config = {
    type: 'doughnut',
    data: {
        datasets: [{
            data: [
               10,20,30
                ],
                backgroundColor: [
                "#F7464A",
                "#46BFBD",
                "#FDB45C"
            ],
        }, {
            data: [
                randomScalingFactor(),
                randomScalingFactor(),
                randomScalingFactor()

            ],
                backgroundColor: [
                "#F7464A",
                "#46BFBD",
                "#FDB45C"
            ],
        }],
        labels: [
            "Red",
            "Green",
            "Yellow"
        ]
    },
    options: {
        responsive: true
    }
};