From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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 set all curves same color

Solved!
Go to solution

Good morning,

 

I have some data I needed to plot and would like to plot all of the curves with the same color.  Normally I would just select each individual curve and set the parameters however there are over 12000 curves and the manual process would take an eternity.

 

Any ideas?

Tim
0 Kudos
Message 1 of 8
(5,337 Views)

Hi,

 

which DIAdem version are you using ?

 

If you are using Diadem 2012, you can try this (it will paint all the curves of 2D diagrams of the active report sheet in turquoise):

 

Dim oMyReportObj, oMyReportObjects
Set oMyReportObjects = Report.ActiveSheet.Objects
For Each oMyReportObj in oMyReportObjects
  If oMyReportObj.ObjectType = eReportObject2DAxisSystem Then
    Dim curveNo
    For curveNo = 1 To oMyReportObj.Curves2D.Count
        oMyReportObj.Curves2D.Item(curveNo).Shape.Settings.Line.Color.SetPredefinedColor(ePredefinedColorDarkTurquoise)
    Next
    
  End If
Next

 

Aurelie

0 Kudos
Message 2 of 8
(5,326 Views)
Solution
Accepted by topic author smoothdurban

Yes I have 2012

 

I ended up settling on this

 

Dim oMyCurves, oMyCurve
View.Sheets(1).Areas(1).DisplayObjType = "CurveChart2D"
Set oMyCurves = View.Sheets(1).Areas(1).DisplayObj.Curves
For Each oMyCurve in oMyCurves
  oMyCurve.Color = "other colors"
  oMyCurve.ColorRGB = RGB(211,211,211)
Next

 

However it takes a very very long time.

 

Tim
0 Kudos
Message 3 of 8
(5,315 Views)

Hi Tim,

 

12000 curves is a really really BIG number of curves.  There's probably a more efficient way of handling this.  What if you concatenated all the data from all those 12000 X and Y channels into 1 pair of X and Y channels that are really really long?  Then you'd just have 1 curve and it would display much faster.  You could insert NoValues between the curve sections in the 1 pair of really really long X and Y channels to prevent ugly connecting lines between the sections on the graph.

 

Brad Turpin

DIadem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 8
(5,303 Views)

Hey Brad thanks for your response.

 

Inserting no values between each concatenated curve sounds interesting.  For display purposes I needed to overlay these 10 - 15K curves over each other so I am not sure how I would do this utilizing your suggestion.

 

I was able to mine through the data and separate it by week (Which brought the total number of curves down to 4000) and used a simple function to find the average.  This approach reduced the amount of curves to display.

 

However I did notice that when I tried to change the color of 14k curves via my script my I7 core CPU was only working at 25%.  Is DIAdem limited on how much of my computers resources it uses?

 

Thanks 

Tim
0 Kudos
Message 5 of 8
(5,248 Views)

Hi Tim,

 

DIAdem 2012 and all previous versions operate on only one cpu core for analysis and graphing activities.  How do you select all the channels to graph?  Are you running a query in the DataFinder, or are you selecting hundreds of data files in the NAVIGATOR tree view, or are you using a multi-select file dialog in your VBScript, or what?

 

I can send you code to load all those values to a small set of channels with NoValue rows between the sets from different original data channels.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 8
(5,203 Views)

Hey Brad,

 

I am selected the data by using the quick search function which allows me to filter out undesireable data.  After I receive the results I select them all and load them all into the data portal.  The load step seems to take a long time but I have encoutered performance issues even when loading larger .MDF files. By larger I mean 62 MB as opposed to the 11 MB files I normally open.

Tim
0 Kudos
Message 7 of 8
(5,181 Views)

Hi Tim,

 

I can set you up with a context me menu in the NAVIGATOR search results that will load the search results and auutomatically concatenate all the channels of the same name from all those selected files/groups/channels.  Do you have access to DIAdem 2012?

 

Do you really need to load all the channels from each file?  If you only need a few channels from each file, it would be faster to query on the group or channel level and load only those channels that you really want.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

 

0 Kudos
Message 8 of 8
(5,170 Views)