Home › forums › Using CanvasJS › How to make y-axis centered rather staying in the left
This topic contains 6 replies, has 3 voices, and was last updated by Suyash Singh 1 year, 10 months ago.
Please check the sample image below
As of now it is not possible to position axisY at the center of the chart. However, you can workaround this by positioning axisY of another chart (without any dataPoint) in the background of current chart. Please check this jsfiddle.
I tried the jsfiddle, it works. Thanks very much for your prompt response. But how can it support zooming in this case? The axisY chart is not zoomed with the main chart.
You can use rangeChanged event of chart1 to programmatically zoom axis of chart2. Please check this updated jsfiddle.
You can also refer tutorial on Sync Zooming and Panning across Multiple Charts.
Thanks. I have one more question, is it possible to export chart1 and chart2 to one png file?
Unnecessary to export chart1 and chart2 to one png file. I did it by screen capturing.
Glad that you found a way to handle it.
You must be logged in to reply to this topic.