Adding custom property to dataPoints- CanvasJS
Adding custom property to dataPoints- CanvasJS
HTML
<script src="http://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 360px; width: 100%;"></div><br/>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "Understanding Labels"
},
axisY: {
labelFontSize: 20,
labelFontColor: "dimGrey"
},
axisX: {
labelAngle: -30
},
data: [
{
type: "column",
dataPoints: [
{ y: 10, label: "Apples" },
{ y: 15, label: "WaterMelon" },
{ y: 25, label: "Oranges" },
{ y: 30, label: "Grapes" },
{ y: 28, label: "Bananas" },
{ y: 30, label: "Apples" },
{ y: 40, label: "Mangos" },
{ y: 45, label: "Oranges" },
{ y: 50, label: "Grapes" },
{ y: 58, label: "Bananas" },
{ y: 60, label: "Apples" },
{ y: 65, label: "Mangos" },
{ y: 75, label: "Oranges" },
{ y: 80, label: "Grapes" },
{ y: 88, label: "Bananas" }
]
}
]
});
chart.render();