Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
m_woolf
Master II
Master II

API for Values on Data Points

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?

1 Solution

Accepted Solutions
m_woolf
Master II
Master II
Author

The exact same code just starting working when I change the true to false and run the code.

Only God (or QlikView) knows why.

View solution in original post

2 Replies
m_woolf
Master II
Master II
Author

The exact same code just starting working when I change the true to false and run the code.

Only God (or QlikView) knows why.

kji
Employee
Employee

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.