Collection: LegendItems
- Updated2024-09-12
- 3 minute(s) read
(BirdsEyeView | Bode | Cascade | Collections | Contour | CurveChart2D | Orbit | Polar | ShaftCenterline) > Collection: LegendItems
Collection: LegendItems
The LegendItems object provides a collection of the Legend entries of an axis system or a contour display in DIAdem VIEW. Use the LegendItems collection to delete legend items or to add new legend items.
The following example displays a name for each legend entry. The DisplayObjType must be a Bode, CurveChart2D, Polar, Orbit, ShaftCenterline, or Contour type:
| VBScript | Python |
Dim oMyLegends, oMyLegendItem, sOutput Set oMyLegends = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems sOutput = "Names of legend items: " & vbCrLf For Each oMyLegendItem in oMyLegends sOutput = sOutput & oMyLegendItem.Name & vbCrLf Next Call MsgBox(sOutput)
The following examples add legend entries. The DisplayObjType must be a Bode, CurveChart2D, Polar, Orbit, ShaftCenterline or Contour type.
Legend with predefined, curve-related legend parameters, for example x-coordinates:
| VBScript | Python |
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:
| VBScript | Python |
Dim oMyLegend2
Set oMyLegend2 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("Length") oMyLegend2.Format = "d"
Legend with static text:
| VBScript | Python |
Dim oMyLegend3
Set oMyLegend3 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("<freetext>") oMyLegend3.Title = "Free Text" oMyLegend3.Format = "Any descriptive text"
Legend with variable contents:
| VBScript | Python |
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:
| VBScript | Python |
Dim oMylegend5
Set oMyLegend5 = View.ActiveSheet.ActiveArea.DisplayObj.LegendItems.Add("<freetext>") oMyLegend5.Title = "Y difference" oMyLegend5.Format = "@@CurrentYDiff@@"
Properties
Returned From
BirdsEyeView.LegendItems | Bode.LegendItems | Cascade.LegendItems | Contour.LegendItems | CurveChart2D.LegendItems | Orbit.LegendItems | Polar.LegendItems | ShaftCenterline.LegendItems
See Also
Procedures
Configuring a Map Display | Configuring a Text Box Display | Deleting Curve Sections and Interpolating over Specified Points | Displaying 2D Axis Systems with Several Y-Axes | Displaying Images in DIAdem VIEW | Displaying Properties in the Legend of a Curve | Displaying the Curve Coordinates | Displaying Videos and Data Synchronously | Finding Values in Channel Tables | Interpolating Curve Points | Setting the Leading Curve | Transferring VIEW Layouts to DIAdem REPORT | Viewing Data as Curves | Zooming and Scrolling Curve Areas
Examples
Analyzing and Displaying Channels Section by Section | Automatic Display of Harmonic Frequencies | Background Segments in DIAdem VIEW | Calculating a Tangent to a Curve | Creating and Viewing Long Data Channels | Dynamic Display of Statistical Characteristic Values in DIAdem VIEW | Overlaying Objects in Videos | User Dialog Box in VIEW for the Calculation of the FFT and Harmonic Frequencies | Vibration Data Analysis with Parallel Processing | Viewing and Automatically Analyzing Data