DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Display x-channel in VIEW legend?

Hello,
 
Does anyone know how to display the x-axis channel name you are graphing against in the VIEW legend (the y-axis channel is displayed as the "Name"). 
 
Thanks! 
Julia
0 Kudos
Message 1 of 14
(5,112 Views)
Hi Julia,

Please open the property dialog box of the 2D axis window in VIEW, add a "<freetext>" and insert the following command:

@@View.ActiveSheet.ActiveArea.DisplayObj.CurrCurve.XChannelName@@

The @ character is needed to show DIAdem that a command follows.

I hope this will help you.

Greetings

Walter
Message 2 of 14
(5,108 Views)

That is great, thank you very much!

 

Julia

0 Kudos
Message 3 of 14
(5,104 Views)
One thing I have noticed though is if I have a 2-d axis system and a channel table visible, and I click on the table, the labels go back to the command view (like @>View.ActiveSheet....).  Is there a way to avoid this?  I am mainly thinking of if someone tries to print the VIEW screen, they will need to make sure to select the graph they want the labels to appear on.
 
Sorry for the trouble! 
 
Julia
0 Kudos
Message 4 of 14
(5,102 Views)
Hi Juila,

Yes, you can use a fix index for the sheets and areas as follows:

@@View.Sheets(1).Areas(1).DisplayObj.CurrCurve.XChannelName@@

Please, keep in mind to change the index depending on the sheet and area you are using.

Greetings
Walter
0 Kudos
Message 5 of 14
(5,093 Views)
Thank you again.  I have a somewhat related question now...
 
I have found I can change the legend width with the "LegendWidth" property.  However, the width of the individual LegendItems do not change; is there a way to change these widths? 
 
I appreciate your help,
 
Julia
0 Kudos
Message 6 of 14
(5,078 Views)

Hi Julia,

This method is missing in the VIEW api in DIAdem 9.1.  I have been told that it has been included now in DIAdem 10, but I don't see any reference to it in the DIAdem 10 Beta1 help system.  The help system is also in Beta, though, so I expect this to be available in DIAdem 10, even though I've not seen it with my own eyes yet.

Brad Turpin
Product Support Engineer
National Instruments

 

Message 7 of 14
(5,071 Views)

Hello,

In DIAdem 2012 I still can't find what the command is to adjust the width of the individual legend items. 

Is there a script command available?

With kind regards,
Stijn

0 Kudos
Message 8 of 14
(4,392 Views)

Hi Stijn80,

 

I don't have DIAdem 2012 easily available, but I found this property in DIAdem 2014, and I tested that it works.  It's probably in DIAdem 2012 as well.

 

View.ActiveSheet.ActiveArea.DisplayObj.LegendItems(1).Width = 100

 

Brad Turpin

DIAdem Product Support

National Instruments

Message 9 of 14
(4,382 Views)

Thanks Brad! This also works with DIAdem 2012.

 

I made a script which does the next adjustments in the VIEW.

- Align the Y-axises
- Remove the Yaxis name
- Selection of the legend items
- Legend width adjustment
- Legend items width adjustment

I used an User dialog box to control the labels in the legend, the Y axis distance to the left, the legend width & the legend items width.

Now I use a pull down selection list for the Y-axis distance & the legend width.
- Is it possible to read the highest digits form the Y-axis channels and adjust the Y-axis distance automatically?
- Is it possible to read the longest length from the channel names displayed in the VIEW and adjust the legend width automatically?

I prefer it to use the VIEW instead of the REPORT, because it is easy to zoom in the VIEW. I use long data sets (vehicle data from weeks) so it consumes a lot of time to look at this data in the REPORT.

 

Another question, how can I pre-select checkboxes in the User dialog box?

 

With kind regards,

Stijn

 

 

 

 

0 Kudos
Message 10 of 14
(4,369 Views)