DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

When displaying multiple curves on one 2d graph in reports how do I force one curve to be in the foreground?

Solved!
Go to solution

When displaying multiple curves on one 2d graph in reports how do I force one curve to be in the foreground? I have two signals and I want to show one overlayed on top of the other. Right now Diadem will only graph it the other way around. I have tried deleting the curves and re-adding them in differnt orders, changin the order they are in the curve list, changing their order inthe data portal, right clicking on the curve and selecting "move to forground" (this only moves the entire 2-d graph object to the foreground). Im using Diadem 12.0 Basic.

 

 

0 Kudos
Message 1 of 13
(7,538 Views)

Hello jdferdon,

 

Here is what I get when I re-arrange the graphs in the Curve and Axis definition in DIAdem 2012:

 

Dialog 1

 

Report

Img1.PNG

 

The only thing I changed in the dialog was the order of the graphs:

 

Dialog 2

 

And this is what I get:

 

Report 2

 

Are you seeing a different behavior? If so, please share your REPORT layout so we can investigate ...

 

      Otmar

Otmar D. Foehner
0 Kudos
Message 2 of 13
(7,529 Views)

Here are some example files. (the same ones I am using with some of the additional data/graphs stripped out) It is the top 2d graph that is giving me problems. 

 

-Joe

Download All
0 Kudos
Message 3 of 13
(7,515 Views)

Hello Joe,

 

I'll need the TDX file with the data that belongs to the TDM header file as well please. TDM files are saved in two actual files, the TDM has the header information, the TDX has the binary data).

 

Thanks,

 

     Otmar

Otmar D. Foehner
0 Kudos
Message 4 of 13
(7,509 Views)

Here they are as a zip. (FYI your forum system does not recognize .tdx as a valid file extension) 

0 Kudos
Message 5 of 13
(7,505 Views)
Solution
Accepted by topic author jdferdon

Hello Joe,

 

I figured out what causes your curves to draw in the wrong "order".

 

You are using two Y-axes, and DIAdem always draws the data for Y1 before Y2, no matter what the order of the curves is in the "Curve and Axis Definition" dialog.

 

I am attaching your layout with a small modification, I changed the Y1 and Y2 axis order (I swapped which Y-axis the data is displayed on), and I get the following result:

 

New Y-axis order

 

Once I looked at your layout it became clear why the order of the curves didn't reflect the order in which the curves were drawn. I didn't know this - so I just learned something new here as well.

 

I hope this answers your question, feel free to ask if there is anything else I can help you with.

 

      Otmar

Otmar D. Foehner
Message 6 of 13
(7,479 Views)

Is it possible to change this drawing behaviour? E.g. draw axis Y2 before axis Y1?

I do ask because i have the same "problem" but i don't want to change multiple reports with multiple axes and curves by hand... 😉 since this would also mean that i have to swap, rescale and rename those axes...

0 Kudos
Message 7 of 13
(4,622 Views)

I had the idea to use the method Copy for ReportObjects to change the index and their drawing order, but it's only available from 2015. Any other code conclusions?

0 Kudos
Message 8 of 13
(4,611 Views)

Hi olhass,

 

If you're using the Report object, and if the curves in question are all assigned to the same Y axis, then you can change the order programmatically with the following commands:

 

Set Graph = Report.ActiveSheet.Objects("2D-Axis1")
Call Graph.Curves2D.Move(3, 1)
Call Report.Refresh()

 

Note that axis Y1 will always be drawn before axis Y2, etc., so if your curves are spread across multiple Y axes, that is a hard restriction.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 9 of 13
(4,578 Views)

Thanks Brad,

but drawing axis Y2 before Y1 was exactly what i wanted to solve... so it's not possible to change the index of the sub object "2D-Axis1"? e.g.

Set rAxes = r2DAxisArea.YAxisList
rAxes.Add("SecondAxis")
rAxes.Add("ThirdAxis")
Set oMyObjects = Report.ActiveSheet.Objects
oMyCopyAxis = oMyObjects.Copy("FirstAxis","FirstAxisToFourth",1)
rAxes.Item("FirstAxis").Name = "FourthAxis"
rAxes.Item("FirstAxisToFourth").Name = "FirstAxis"

Wouldn't this change the reference (curves objects reference to the name of the axis object) of all curves to "index" 4 of the axis list, and so plot these curves on top? I can't test this.

0 Kudos
Message 10 of 13
(4,557 Views)