{}
Pie chart
css
js
html
libs + Add Library
HTML
<div style="width: 500px"> <canvas id="pie_chart" width="400" height="200"></canvas> </div>
CSS
JS
var ctx = document.getElementById("pie_chart").getContext('2d'); var myChart = new Chart(ctx, { type: 'pie', data: { labels: ['Point 1', 'Point 2', 'Point 3', 'Point 4'], datasets: [{ labels: "Pie chart", data: [20, 50, 40, 30], backgroundColor: ["red", "blue", "orange", "green"] }] } });