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 2 months, 4 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #14768

    yueming
    Member

    Please check the sample image below

    sample image

    • This topic was modified 6 months, 2 weeks ago by  yueming.
    #14772

    Suyash Singh
    Moderator

    @yueming,

    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.
    ___
    Suyash Singh
    Team CanvasJS

    #14803

    yueming
    Member

    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.

    • This reply was modified 6 months, 1 week ago by  yueming.
    #14816

    Vishwas R
    Keymaster

    @yueming,

    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.


    Vishwas R
    Team CanvasJS

    #15595

    yueming
    Member

    Thanks. I have one more question, is it possible to export chart1 and chart2 to one png file?

    #15603

    yueming
    Member

    Unnecessary to export chart1 and chart2 to one png file. I did it by screen capturing.

    #15605

    Suyash Singh
    Moderator

    @yueming,

    Glad that you found a way to handle it.

    ___
    Suyash Singh
    Team CanvasJS

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.