Home › Forums › Chart Support › How to put the YAxis lines in a row? › Reply To: How to put the YAxis lines in a row?
@jeonkook,
Aligning y-axis for multiple charts can be achieved by setting the margin property. The margin value has to be calculated based on the bounds of y-axis as shown in the code below –
for(var i = 1; i < charts.length; i++) { charts[i].axisY[0].set("margin", charts[0].axisY[0].bounds.x2 - (charts[i].axisY[0].bounds.x2 - charts[i].axisY[0].bounds.x1)); }
Also, kindly take a look at this updated JSFiddle with the code to align the y-axis for multiple charts.
___________ Indranil Deo Team CanvasJS