Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set "Max Visible Number" (Presentation Tab) in Diagram by Macro? (QV10)

Hi,

I would like to create a macro (to be executed with a button) which sets the property "Max Visible Number" in the upper right corner of the Presentation Tab in the options of a bar diagram, on e.g. 10 or x+5 or something like that. Unfortunately I can't find specific information in the API Guide. Has perhaps someone experience with that? Thanks a lot in advance, Martin

15 Replies
Not applicable
Author

Hi,

thanks a lot, it works perfect. 🙂

May I ask another question which was actually the idea before this? Would it be possible to enter a formula in the box next to the "Max Visible Number" which checks if the diagram is maximized, and sets the number of visible bars depending on that?

Regards,

Martin

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    Here is the code

set chart = ActiveDocument.GetSheetObject("CH07")

set cp = chart.GetProperties

set dims = cp.Dimensions

if chart.IsMaximized then

    dims(0).MaxNumShown.v = 9

else

    dims(0).MaxNumShown.v = 3

end if

chart.SetProperties cp

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

Thanks for that. But I guess this is just macro-code, right? Can't I use it in a way that the number of bars is adjusted as soon as someone maximizes (or un-maximizes) the diagramm?

Thanks a lot,

Martin

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    No there are no action available for minimize and maximize.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Ok, thank you.

Not applicable
Author

Thank you two espically Kaushik Solanki  for the solution of this problem, I have met this issue too.that waste me a lot of time since API Guide is wrong.

by the way,the damn official API Guide is super terrible, that should be called dictionary instead of guide.......not even a tiny progress since QV 7.0....that's a nightmare  even for a expert of vb developer.