Javascript examples for Chart.js:Pie Chart
Chart js, pie chart with border radius
<html> <head> <title>Chart.js Pie chart demo</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js Copy"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0-rc.1/Chart.js"></script> <style id="compiled-css" type="text/css"> .container {/*from w w w. ja v a 2 s.c om*/ width: 80%; margin: 15px auto; } </style> <script type="text/javascript"> window.onload=function(){ var ctx = document.getElementById("myChart").getContext('2d'); var myChart = new Chart(ctx, { type: 'pie', data: { labels: ["Green", "Blue", "Gray", "Purple", "Yellow", "Red", "Black"], datasets: [{ backgroundColor: [ "#2ecc71", "#3498db", "#95a5a6", "#9b59b6", "#f1c40f", "#e74c3c", "#34495e" ], borderWidth: [0, 0, 0, 0, 0, 0, 0], data: [12, 19, 3, 17, 28, 24, 7] }] } }); } </script> </head> <body> <div class="container"> <h2>Chart.js ? Pie Chart Demo</h2> <div> <canvas id="myChart"></canvas> </div> </div> </body> </html>