Home Forums Chart Support How to Create a 1:1 Ratio Scale Chart in Canvasjs Reply To: How to Create a 1:1 Ratio Scale Chart in Canvasjs

#40351

@likewatchk,

Setting axisY viewportMinimum & viewportMaximum same as axisX in rangeChanged event-handler should work in your case. Please find the code-snippet below.

rangeChanged: function(e){
  e.chart.axisY[0].set("viewportMinimum", e.axisX[0].viewportMinimum, false);
  e.chart.axisY[0].set("viewportMaximum", e.axisX[0].viewportMaximum);      
}

Please take a look at this JSFiddle for a working example.


Vishwas R
Team CanvasJS