Home forums Using CanvasJS Hide AxisY

Tagged: 

This topic contains 6 replies, has 3 voices, and was last updated by  nsn 2 months, 1 week ago.

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

    I got a chart with 2 Y axis. It looks like the 2nd sample on this page: https://canvasjs.com/docs/charts/chart-options/axisy/ the one labeled Multiple Y axis.

    I would like to hide the second Y axis with title “Axis Y 2 Title”. I only want it to hide not remove it. I can set a blank title but the tick marks are still there. Is it possible?

    Edit: Looks like I ask to soon. I found the answer already

    I set it to something like this

            title: "",
            title: "",
            gridThickness: 0,
            tickLength: 0,
            lineThickness: 0,
            labelFormatter: function(){
              return " ";
            }   
    • This topic was modified 1 year, 7 months ago by  papito.
    #20266

    @papito,

    Setting the lineThickness and tickThickness to 0 will work fine in your case. Please take a look at this jsfiddle.

    ___________
    Indranil Deo
    Team CanvasJS

    #26629

    nsn

    Hi, this is not working correctly when having values < 0

    data: [
          {
            type: "column",
            dataPoints: [
            { x: 10, y: 71 },
            { x: 20, y: 55},
            { x: 30, y: 50 },
            { x: 40, y: 65 },
            { x: 50, y: -95 },
            { x: 60, y: -68 },
            { x: 70, y: -28 },
            { x: 80, y: -34 },
            { x: 90, y: 14}
            ]
          }
          ]

    It keeps show the ‘-‘ , How can we overcome this ?

    #26640

    @nsn,

    It seems to be working fine and not showing any ticks ‘-‘. Can you kindly create JSFiddle reproducing the issue and share it with us so that we can look into the code, understand the scenario and help you out?

    ___________
    Indranil Deo
    Team CanvasJS

    #26641

    nsn
    #26649

    @nsn,

    Setting valueFormatString defines the format for labels appearing on Axis Y, which doesn’t include the negative symbol (-) incase of negative number. Using labelFormatter should work fine in this case. Please take a look at this updated JSFiddle.

    ___________
    Indranil Deo
    Team CanvasJS

    #26650

    nsn

    Thanks

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

You must be logged in to reply to this topic.