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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

create a gauge chart using macro

Hi,

I want to Create Gauge Chart using macro with min gauge setting to 0.5 and Max Gauge Setting to 1.2 and Segment 2 lowerbond with Expression

2 Replies
marcus_sommer

You could create this and adjust the properties with code (examples from APIGuide.qvw) like this:

set Graph = ActiveDocument.Sheets("Main").CreateGaugeChart

Graph.AddExpression "sum(Amount)"

set chart = ActiveDocument.GetSheetObject("CH01")

set gp = chart.GetProperties

set gs = gp.ChartProperties.GaugeSettings.GaugeSegments

for i = 0 to gs.Count-1

    gs.Item(i).Name.v = i

next

  chart.SetProperties gp

But why do you want create this per macro? If you need some flexibilities you could use conditions and variables within the chart to meet other requirements.

- Marcus

oknotsen
Master III
Master III

Do not make the same topic multiple times. It is considered spamming.

Create Gauge Chart Using Macro

May you live in interesting times!