Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Property: Format for LegendItem

DIAdem 2011 Help

Edition Date: July 2011

Part Number: 370859J-01

»View Product Info

Specifies how DIAdem formats text and numbers in the legend of a 2D axis system in DIAdem VIEW.

Object.Format 
Object LegendItem
Object with this property
Object.Format String with read and write access

The following example assigns all legend entries in a 2D axis system the same format:

Dim oMyLegends, oMyLegendItem
Set oMyLegends = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems
For Each oMyLegendItem in oMyLegends
  oMyLegendItem.Format = "d.dd"
Next

The following example inserts new legend entries into a 2D axis system. The DisplayObjType property must be a CurveChart2D type.

Legend with predefined, curve-related legend parameters, for example x-coordinates:

Dim oMyLegend1: Set oMyLegend1 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("CursorX")
oMyLegend1.Format = "d.dd"

Legend with channel-related base properties or custom properties, for example, channel length:

Dim oMyLegend2: Set oMyLegend2 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("Length")
oMyLegend2.Format = "d"

Legend with static text:

Dim oMylegend3: Set oMyLegend3 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("<freetext>")
oMyLegend3.Title = "Free Text"
oMyLegend3.Format = "Any descriptive text"

Legend with variable contents:

Dim oMyLegend4: Set oMyLegend4 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("<freetext>")
oMyLegend4.Title = "Current Date"
oMyLegend4.Format = "Date: @CurrDate@"

Legend with script expressions or user commands:

Dim oMyLegend5: Set oMyLegend5 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("<freetext>")
oMyLegend5.Title = "Y difference"
oMyLegend5.Format = "@@CurrentYDiff@@"


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit