CanvasJS.addColorSet(“greenShades”,
[“#FF5733”,
“#FFC300”,
“#28B463”,
]);
function compareDataPointYDescend(dataPoint1, dataPoint2)
{
return dataPoint2.y – dataPoint1.y;
}
var seasondata = [];
for (let index = 0; index < dataset.length; index++) {
const element = dataset[index];
seasondata.push({label: labelset[index] , y:dataset[index]})
}
var chart = new CanvasJS.Chart(“pie-chart”,
{
colorSet: “greenShades”,
animationEnabled: true,
theme: “light1”,
title:
{
text: “Fix Response Time for P3/P4″
},
axisY:
{
title :”Case Age”,
titleFontSize:15,
interval:50,
},
axisX:
{
title :”Case Number”,
titleFontSize:15,
interval:5,
},
legend:
{
horizontalAlign: “center”,
verticalAlign: “top”
},
data:[{
bevelEnabled: true,
type: “column”,
//showInLegend: true,
dataPoints: seasondata.sort(compareDataPointYDescend)
}]
});
chart.render();