JSFiddle - React, Tailwind, and code Playground

by Aditya Shrivastava

HTML

<div>
<div id="chartContainerpie" style="height: 300px; width: 100%;"></div>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
</div>

CSS

display : inline-block

JavaScript

var chart = new CanvasJS.Chart("chartContainer", {
        title:{
            text: "My First Chart in CanvasJS"              
        },
        data: [              
        {
            // Change type to "doughnut", "line", "splineArea", etc.
            type: "doughnut",
            dataPoints: [
                { label: "apple",  y: 10  },
                { label: "orange", y: 15  },
                { label: "banana", y: 25  },
                { label: "mango",  y: 30  },
                { label: "grape",  y: 28  }
            ]
        }
        ]
    });
    chart.render();
    var chart = new CanvasJS.Chart("chartContainerpie", {
        data: [              
        {
            // Change type to "doughnut", "line", "splineArea", etc.
            type: "pie",
            dataPoints: [
                { label: "apple",  y: 10  },
                { label: "orange", y: 15  },
                { label: "banana", y: 25  },
                { label: "mango",  y: 30  },
                { label: "grape",  y: 28  }
            ]
        }
        ]
    });
    chart.render();
}