11-12-2013 11:00 AM
Hello,
I want to set the width of a legend using script. I can set its position, but cannot influence its size, which appears to be adjusted automatically. Usually, it is too small to be legible. How can I do this? So far I have being using (unsuccessfully) these varaiables:-
D2LegPosX
D2LegPosY
D2LegTxtSizeAut
D2LegSizeGlX
D2LegTxtType
D2CCurveLegTxt
D2LegDraw = true
Can anyone guide me please? Obviously, I am missing something....
Thanks in advance
11-12-2013 05:03 PM
Sounds like you legend size is still set to "Automatic legend size". Please change this parameter to "Fixed legend size" in the dialog and you should be able to adjust the legend width using variables in a Script.
11-13-2013 09:23 AM
Hi Otmar,
Thanks for the explanation. Is there a way to change that option by script? Then the macro containing it could be used by different users without each one having to make manual changes.....
Thanks!
11-14-2013 08:57 AM
You can set that option with the following code. This code was created given the name of the plot was 2D-Axis1.
Dim oCurveLegend, oLegendPosition
'------------------- CurveLegend ------------------------------
Set oCurveLegend = Report.ActiveSheet.Objects.Item("2D-Axis1").CurveLegend
'------------------- LegendPosition ------------------------------
Set oLegendPosition = oCurveLegend.Position
oLegendPosition.SizeMode = eLegendSizeFixed
11-14-2013 10:29 AM
Hi Jesse,
Thank you very much.
11-15-2013 10:28 AM
You're welcome.