Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bsturgis
Contributor
Contributor

Change Scatter Chart Dimenions on the fly...

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.

1 Solution

Accepted Solutions
sbaldwin
Partner - Creator III
Partner - Creator III

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

View solution in original post

2 Replies
sbaldwin
Partner - Creator III
Partner - Creator III

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

Not applicable

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.