Home › forums › Using CanvasJS › IndexLabel placement
Tagged: Column, indexlabel, stacked
see this example.
I have specified indexLabelPlacement: "outside". But not all the indexLabel are completely outside, first column’s indexLabel is inside at the top.
I want the indexLabel to be completely outside so that it will look uniform.
How to do that?
IndexLabel of first dataPoint is placed inside as there is no space to position it outside the column. Increasing axisY maximum to a value greater than larger dataPoint value will make space for indexLabel to render it outside column. Please take a look at this updated jsfiddle.
Ok, but your code hardcode the maximum value of y-axis. We can find the maximum value by iterating over each data point.
But is there any inbuilt feature for finding the maximum value. And how much offset to take for y-axis maximum value?
And, how to handle the same problem for stacked column chart like this?
You can set axis maximum based on the maximum of sum of dataPoints from all dataSeries. Please take a look at this updated jsfiddle.
You must be logged in to reply to this topic.