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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax for updating chart label via macro

I'm using a macro to swap out dimensions on a chart via button.  However, when the new dimension is inserted, I lose the custom label, which is a variable 'vTimeView'.  I'm looking for the VB syntax to update the dimension label for object CH54.  Thoughts?

Thanks,

Kevin

1 Reply
Not applicable
Author

I think they're calling the attribute Title for dimensions (even though there is a ShowLabel attribute as well).

From the API Guide:

set chart = ActiveDocument.Activesheet.CreateStraightTable

chart.AddDimension "ProductType"

chart.AddExpression "sum(Amount)"

chart.AddExpression "count(Customer)"

set cp = chart.GetProperties

set dims = cp.Dimensions

dims(0).Title.v = "Type of product"

chart.SetProperties cp

Keep in mind the dimensions are an array, so if you have more than one, make sure you refer to the correct one. dims(#).