From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Create Legend and Label Graph using VBS

Solved!
Go to solution

Hi,

 

I've scoured the internet before I had to resort to asking my question here. I hope someone can answer my question.

 

Using VBS, how can I create a legend of the channels used in the graph and label the axis in the graph? Thanks in advance!

 

0 Kudos
Message 1 of 3
(5,248 Views)
Solution
Accepted by topic author neocoolstar

I've managed to figure out how to create the labels...

 

Call GraphObjOpen(D2AxisXObj(1))
        D2AxisXTxt = "@@ChnName(CurrChnNo)@@ [@@ChnDim(CurrChnNo)@@]" ' Defines the x-label
Call GraphObjClose(D2AxisXObj(1))

 Now to figure out how to create the legend. If anyone can help me, that'd be great.

 

 

 

...And now I feel like a downright idiot.

 

After more scouring I managed to find what I need

Call GraphObjOpen("2D-Axis1")
  '------------------- Swith legend on -------------------------------
  D2LEGDRAW        =1

  D2LEGTXTTYPE     ="Free text" ' "ChannelName" or other keywords
  D2LEGTXTFREE     ="My free legend"

Call GraphObjClose("2D-Axis1")
'redraw
Call Picupdate()

 

 

0 Kudos
Message 2 of 3
(5,242 Views)

Removed

0 Kudos
Message 3 of 3
(5,240 Views)