The reason may be that you are using the latest chart.min.js but using the old code. For correct reference, follow the chartjs.org documentation.
The code configuration structure has changed in the latest release. (I guess from 2.3 onwards)
So, instead of
var countries= document.getElementById("countries").getContext("2d");
var chart = new Chart(countries).Pie(pieData,pieOptions);
We are structuring like:
var countries= document.getElementById("countries").getContext("2d");
var chart = new Chart(countries,{
type: 'pie',
data:
{
labels: ['India', 'Germany', 'Netherland'],
datasets:
[{
backgroundColor: '#337ab7',
data: ['100', '99' ,'98'],
borderWidth:1,
}]
},
options:
{
responsive: true,
maintainAspectRatio:false,
legend: {
display: false,
position: 'top'
}
}
});
or
var countries= document.getElementById("countries").getContext("2d");
var pieData =
{
labels: ['India', 'Germany', 'Netherland'],
datasets: [{
backgroundColor: '#337ab7',
data: ['100', '99' ,'98'],
borderWidth:1,
}]
};
var pieOptions =
{
responsive: true,
maintainAspectRatio:false,
legend: {
display: false,
position: 'top'
}
};
var chart = new Chart(countries,{
type: 'pie',
data: pieData,
options: pieOptions
});