Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
Quick question on chart properties. I am working on building a VB Script code repository for Chart Objects. I need the name of the property to toggle the Expression As Legend option. I had looked into the API guide and could not find one. Please can someone answer this one?
Many thanks in advance.
Cheers - DV
Hi,
Try this code.
sub abc
set chart = ActiveDocument.ActiveSheet.CreateBarChart
chart.AddDimension "CustomerID"
chart.AddExpression "sum(1)"
chart.AddExpression "count(1)"
set p = chart.GetProperties
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ShowExpressionLabel = true 'True to check Expression as Legend
set expr = p.Expressions.Item(1).Item(0).Data.ExpressionVisual
expr.ShowExpressionLabel = false 'false to uncheck Expression as Legend
chart.SetProperties p
end sub
Regards,
Kaushik Solanki
Hi,
Try this code.
sub abc
set chart = ActiveDocument.ActiveSheet.CreateBarChart
chart.AddDimension "CustomerID"
chart.AddExpression "sum(1)"
chart.AddExpression "count(1)"
set p = chart.GetProperties
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ShowExpressionLabel = true 'True to check Expression as Legend
set expr = p.Expressions.Item(1).Item(0).Data.ExpressionVisual
expr.ShowExpressionLabel = false 'false to uncheck Expression as Legend
chart.SetProperties p
end sub
Regards,
Kaushik Solanki
Kaushik - You are the star mate. Thank you very much for the code. Just curious to know... where are you based? and since how long are you using QV?
Also please can you help me with this post....
http://community.qlik.com/message/126614#126614
Cheers - DV