DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

legend width

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

 

0 Kudos
Message 1 of 6
(5,996 Views)

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.

 

Legend.png

Otmar D. Foehner
Message 2 of 6
(5,992 Views)

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!

0 Kudos
Message 3 of 6
(5,973 Views)

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

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(5,953 Views)

Hi Jesse,

 

Thank you very much.

0 Kudos
Message 5 of 6
(5,951 Views)

You're welcome.  

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(5,943 Views)