Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to be able to toggle between a regular bar graph and a stacked bar graph. Is there a way do this?
Make both charts. Then use a variable to show or hide the charts as needed.
You can put this code in your Edit module
Sub ChangeChart()
set chart = ActiveDocument.GetSheetObject("NAME OF YOUR CHART")
set p = chart.GetProperties
if p.ChartProperties.BarModeStacked = True then
p.ChartProperties.BarModeStacked = false
else
p.ChartProperties.BarModeStacked = True
End if
chart.SetProperties p
End sub
Then you can set a button and its action should point to this Macro.
Each click will toggle between stacked or grouped
Hope it helps.
If you plan to use a macro that calls chart.SetProperties in the Server environment, please take note of this warning from section 80.2 of the Ref Guide.
"The following types of functionality are not to be used in the QlikView Server environment , as they may
cause unexpected results:
- Layout operations acting on the properties of sheets and sheet objects via SetProperties"
-Rob