Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
Does anyone know of a way of finding out which option of a fast change chart is currently in use. I want to be able to be able to identify this in the actual chart expression, so that it can be manipulated depending on type of chart.
Thanks
Andrew
Not entirely sure of a 100% solution for that but something that may be a useful starting point is to control the Fast Change / Chart Types manually, the following code covers both areas:
set chart = ActiveDocument.Sheets("Main").CreateBarChart
chart.AddDimension "ProductType"
chart.AddExpression "sum(Amount)"
set p = chart.GetProperties
p.GraphLayout.FastChange.Bar = true
p.GraphLayout.FastChange.Line = true
p.GraphLayout.FastChange.Combo = true
p.GraphLayout.FastChange.Pie = true
p.GraphLayout.FastChange.Scatter = false
p.GraphLayout.FastChange.Straight = false
p.GraphLayout.FastChange.Pivot = false
p.ChartProperties.FastChangeInChart = true
chart.SetProperties p
chart.SetChartType 4 'line
Hopefully that will be of some use.
All the best,
Matt - Visual Analytics Ltd
@QlikviewBI
Thanks Matt
Unfortunately I don't know of an event that would be able to be used to fire off a macro call to check the ChartType.
Interestingly the SetChartType property is not defined in the API guide, but is referred to in one of the examples, so not sure if there is an actual GetChartType property anyway?
Andrew
You can use the GetObjectType method of the chart.
chart.GetObjectType