add script at head tag
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
add html code where you want to show the pie chart
<canvas id="pieChart" height="200" width="300" style="width: 210px; height: 105px;"></canvas>
add this code at footer or on document ready function if you using jQuery.
<script >
var pieChartCanvas = $('#pieChart').get(0).getContext('2d');
var pieChart = new Chart(pieChartCanvas);
var PieData = [
{
value : 700,
color : '#f56954',
highlight: '#f56954',
label : 'Chrome'
},
{
value : 500,
color : '#00a65a',
highlight: '#00a65a',
label : 'IE'
},
{
value : 400,
color : '#f39c12',
highlight: '#f39c12',
label : 'FireFox'
},
{
value : 600,
color : '#00c0ef',
highlight: '#00c0ef',
label : 'Safari'
},
{
value : 300,
color : '#3c8dbc',
highlight: '#3c8dbc',
label : 'Opera'
},
{
value : 100,
color : '#d2d6de',
highlight: '#d2d6de',
label : 'Navigator'
}
];
var pieOptions = {
segmentShowStroke : true,
segmentStrokeColor : '#fff',
segmentStrokeWidth : 1,
percentageInnerCutout: 50,
animationSteps : 100,
animationEasing : 'easeOutBounce',
animateRotate : true,
animateScale : false,
responsive : true,
maintainAspectRatio : false,
};
pieChart.Doughnut(PieData, pieOptions);
</script>