Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anyone know if there is a way to change the dimensions of a chart, specifically a XY scatter chart, on the fly using buttons or actions? What we want to do is give the user the ability to create their own chart by giving them a set of buttons the will change either the X or Y axis with the dimension or measure of their choice.
Hi, you would need to set the some variables with the names of the fields you want on the X/Y axis then use a $ expansion, i have included a really simple example.
Thanks
Steve
Hi, you would need to set the some variables with the names of the fields you want on the X/Y axis then use a $ expansion, i have included a really simple example.
Thanks
Steve
Expression can be dynamically changed using variables. Dimension toggle needs macro to change.
For example:
Create a variable vSelectDimension and assign it a value when a button is clicked.
Add the below macro in the macro editor and call it in the button
Sub ToggleDimension
set chart = ActiveDocument.GetSheetObject("CH01")
Set TB = ActiveDocument.Variables("vSelectDimension") 'Can be Variable/Listbox selection/Possible Values/Selected values etc...
NewDim = TB.GetContent.String
chart.RemoveDimension 1 'Remove Old Dimension
chart.AddDimension NewDim 'Add New Dimension
End Sub
Hope this helps,
Kiran.