Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
brian_booden
Partner Ambassador
Partner Ambassador

Hiding the Y axis using macro

I have written a small macro to hide the X-axis on a (bar) chart when a button is pushed, as per below:

sub HideXAxis

          set chart = ActiveDocument.GetSheetObject("CH111")

 

          set p = chart.GetProperties

          p.ChartProperties.XAxis.Show = false              

          chart.SetProperties p

end sub

I also want to be able to hide the Y-Axis at the same time, but cannot find the syntax to do it.  Is this possible, and if so, how?

Regards,

Brian

3 Replies
brian_booden
Partner Ambassador
Partner Ambassador
Author

Can anyone make any suggestions on this?  I have had another good sift through the API Guide and cannot find equivalent Y-Axis properties.

I have a manual workaround currently where i can set the the font colour of the Y-Axis to the colour of the background, effectively hiding it, using a variable as a toggle.  But i am not keen on embedding expressions into every font colour of Y-Axis objects through my application.  I would rather trigger the properties through a macro, similar to my previous post.

Any suggestions would be really appreciated.

Regards,

Brian

Not applicable

He Brian,

Why don't you make two different graphs. One graph with an y-axis and one graph without an y-axis.

Then show the graphs conditionally, dependent of the value of a variable.

You can create a button to change the value of the variable.

For eg:

Make a button wich sets the variable vShow to 0. And one button to set the variable vShow to 1.

If vShow=0 you show the graph with the y-axis. If vShow=1 you show the graph without the y-axis.

This way you don't need a macro and you can use a trigger which will still work with ajax client.

Hope that helps.

gr.

Frank

rustyfishbones
Master II
Master II

Hi Brian,

Did you ever figure this out?

Regards

Alan