indexLabelPadding: Number/Object

This property allows you to set the padding for indexlabel at datapoint level.

Default: 0
Example: 2, 4,…
var  chart =  new  CanvasJS.Chart("container", {
 .
 .
 data: [{
       dataPoints: [
           { x: 10, y: 71, indexLabelPadding: 2 },
           .
           .
       ]
 }],
 .
 . 
});
chart.render();

indexLabelPadding can also be an object containing top, right, bottom and left properties for different padding along top, right, bottom and left sides, respectively.

var  chart =  new  CanvasJS.Chart("container", {
 .
 .
 data: [{
       dataPoints: [
           { x: 10, y: 71, indexLabelPadding: { top: 1, right: 1, bottom: 2, left: 2 }
       ]
 }],
 .
 . 
});
chart.render();

Try Editing The Code


If you have any questions, please feel free to ask in our forums.Ask Question