You must be logged in to post your query.
Home › Forums › Chart Support › Hide AxisY
Tagged: axisY
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 " "; }
@papito,
To hide the axis line and tick you can set the lineThickness and tickThickness to 0. Please check the below code snippet to hide the axis line and tick –
{ title: "", tickThickness: 0, lineThickness: 0, labelFormatter: function(){ return " "; } }
Also, kindly take a look at this JSFiddle for a working sample.
___________ Indranil Deo Team CanvasJS
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 ?
@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?
https://jsfiddle.net/oht2m98k/
Setting valueFormatString defines the format for labels appearing on Axis Y, which doesn’t include the negative symbol (-) incase of negative number. Instead, using labelFormatter to return an empty string should work fine in this case. Please check the below code snippet –
axisY:{ title: "", tickLength: 0, lineThickness:0, margin:0, labelFormatter: function(e) { return ""; } },
Also, kindly take a look at this updated JSFiddle.
Thanks
You must be logged in to reply to this topic. Login/Register