DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

type 2d axis

Solved!
Go to solution

Hi All, 

 

I am writing a script to plot some graphs and I would to change the type of some of them to "Step Curve". How can I do that? Here is my script;

 

Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim oMySheet, oNewArea, Channel, Channels
Call View.Sheets.RemoveAll
Set oMySheet = View.Sheets.Add("Graphs Boilers 1-5")
Set oNewArea = oMySheet.ActiveArea
oNewArea.DisplayObjType ("CurveChart2D")
Set Channels = Data.GetChannels("[1]/*ALL*")
FOR Each Channel In Channels
Call oNewArea.DisplayObj.Curves.Add("[1]/Time", Channel.GetReference(eRefTypeIndexName))
' Looking for Boiler 1
NEXT
Dim Boiler1Term1, Boiler1Term1s
Set Boiler1Term1s = Data.GetChannels("[1]/*Boiler 1 M2G Terminal*")
FOR Each Boiler1Term1 In Boiler1Term1s
Call oNewArea.DisplayObj.Curves.Add("[1]/Time", Boiler1Term1.GetReference(eRefTypeIndexName))
Dim Boiler1GV, Boiler1GVs
Set Boiler1GVs = Data.GetChannels("[1]/*Boiler 1 Gas*")
FOR Each Boiler1GV In Boiler1GVs
Call oNewArea.DisplayObj.Curves.Add("[1]/Time", Boiler1GV.GetReference(eRefTypeIndexName))
NEXT

View.Sheets("Graphs Boilers 1-5").Areas("Area : 1").DisplayObj.YScaling = "n systems [phys.]"
Call WndShow("VIEW","Open")
Next

 

 

Many thanks

 

Estefania

0 Kudos
Message 1 of 3
(3,943 Views)
Solution
Accepted by topic author emendezcampa

Hi there,

 

There is an object property that specifies the type of curve presented on a 2D Axis graph. You can read about it in the article below;

 

http://zone.ni.com/reference/en-XX/help/370858K-01/scriptview/properties/view_property_type_itocurve...

 

So should just be.. oNewArea.Type = "Step Curve"

 

Hope this helps, let me know if you have any questions.

 

Thanks,

 

Josh

0 Kudos
Message 2 of 3
(3,908 Views)

Thanks Josh, it works

 

Regards

0 Kudos
Message 3 of 3
(3,862 Views)