Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How can I label the y-axis with the names of all the curves displayed on the axis?

Primary Software: DIAdem
Primary Software Version: 10.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: Is there any way of labeling the y-axis of a 2D axis system with the names of all the channels displayed on the axis?

Solution: Register one of the user functions listed below and enter the following text as the axis label:

Function for channel names:
@@AllAxisChannelNames@@

or.

Function for channel names and unit:
@@AllAxisChannelNamesandUnits@@


The following are the user functions for the type of display requested here:

''1. Display all channel names:
Function AllAxisChannelNames
  Dim lChnNoT,lCurveT
  AllAxisChannelNames = ""
  Call GraphObjOpen(GraphObjName)
  For lCurveT = 1 To CURVENOMAX
    if ( 0 = Len(D2CURVEOBJ(lCurveT)) ) Then Exit For
    if D2AXISPAIRNO(lCurveT)= CurrAxisNo then
    If ( 0 < Len(AllAxisChannelNames) ) Then AllAxisChannelNames =AllAxisChannelNames & ", "
      lChnNoT = CInt(D2CHNY(lCurveT))
      AllAxisChannelNames = AllAxisChannelNames & Chnname(lChnNoT)
    end if
  Next
  Call GraphObjClose(GraphObjName)
End Function
'2. Display all channel names and units:
Function AllAxisChannelNamesAndUnits
  Dim lChnNoT,lCurveT
  AllAxisChannelNamesAndUnits= ""
  Call GraphObjOpen(GraphObjName)
  For lCurveT = 1 To CURVENOMAX
    if ( 0 = Len(D2CURVEOBJ(lCurveT)) ) Then Exit For
    if D2AXISPAIRNO(lCurveT)= CurrAxisNo then
    If ( 0 < Len(AllAxisChannelNamesAndUnits) ) Then AllAxisChannelNamesAndUnits =AllAxisChannelNamesAndUnits& ", "
      lChnNoT = CInt(D2CHNY(lCurveT))
      AllAxisChannelNamesAndUnits= AllAxisChannelNamesAndUnits & ChnName(lChnNoT)&" ["&ChnDim(lChnNoT)&"]"
    end if
  Next
  Call GraphObjClose(GraphObjName)
End Function




Related Links:

Attachments:





Report Date: 11/03/2006
Last Updated: 11/07/2006
Document ID: 4316QSPY

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit