Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I got this code for controlling an existing chart from the API guide:
set chart=ActiveDocument.GetSheetObject("CH17")
set p = chart.GetProperties
p.ChartProperties.NumbersOnDataPointsLocation = 1 '1 - Inside segments, 0 - On top
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ShowAsBar = true
expr.NumbersOnBars = true
p.ChartProperties.NumbersOnBarsTextMode = 1 '1 vertical, 0 horizontal
chart.SetProperties p
All seems to work as expected except expr.NumbersOnBars=true. When I change the true to false and run the code, nothing happens. I want the user to be able to show or hide the data values by clicking a button.
Any ideas?
The exact same code just starting working when I change the true to false and run the code.
Only God (or QlikView) knows why.
The exact same code just starting working when I change the true to false and run the code.
Only God (or QlikView) knows why.
We originally had 2 different ways to show Values on Datapoints, the properties were called NumbersOnBars and
ShowAsTextInChart, in version 9 (i think it was) we wanted to simplify properties and make them both into one setting.
To keep the backward compatibility Values will now be shown if either of these values is true. So most likely you had a ShowAsTextInChart set to true when trying to work it out at first.
To make sure the code works you should set both of them to the same value.