Home Forums Chart Support Dynamic indexLabelOrientation Reply To: Dynamic indexLabelOrientation



You can set indexLabelOrientation property to “vertical” or “horizontal” depending on the number of datapoints and update the chart options. Please find the code snippet below,

if(chart.options.data[0].dataPoints.length > 15)
    chart.options.data[0].indexLabelOrientation = "vertical";
    chart.options.data[0].indexLabelOrientation = "horizontal";

Please take a look at this JSFiddle for working example.

dynamically change index label orientation

Adithya Menon
Team CanvasJS