DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning curves to axis (and setting axis color) in report

I'm creating a script that will generate a report.
As a template for this report i have a tdr file with one 2D axis system.
The channels to be displayed are stored in an global array, it can be any number of channels (hypothetically).

Now for each channel I want to:
Create a new curve.
Create a new y-axis (except for the first, cause there is already one present)
Assign the y-axis to the corresponding curve
Assign the y-axis color to be the same as the corresponding curve.

Creating several curves workes fine (and displaying them).
Creating several y-axis workes fine as well.

However, the last two operations are not as straightforward. Should the y-axis be assigned to the curve or the other way around (basicly, how is this done)?

Setting the y-axis color sounds easy enough, from the help file:
"D2AxisYLineColor: Specifies the color of the selected y-axis."
However, when i use this command it doesn't change anything. Example:

Call GraphObjOpen("2DAxis1")
Call GraphObjOpen(D2AxisYObj(1))
D2AxisYTxtColor ="red"
D2AxisYLineColor = "red"
Call GraphObjClose(D2AxisYObj(1))
Call GraphObjClose("2DAxis1")

This code WILL change the label text color (as expected), the line color (which i believe is supposed to be the color of the axis itself) remains unchanged. What am i missing here?
0 Kudos
Message 1 of 6
(4,577 Views)
Hi Salte
 
You missed only one line
 
Call GraphObjOpen("2DAxis1")
D2AXISINDIVIDCOL = 1
Call GraphObjOpen(D2AxisYObj(1))
D2AxisYTxtColor ="red"
D2AxisYLineColor = "blue"
Call GraphObjClose(D2AxisYObj(1))
Call GraphObjClose("2DAxis1")
 
Press CTRL-A when you open the definition dialog to get all parameters.
 
Hope this helps
Winfried
0 Kudos
Message 2 of 6
(4,572 Views)
Thanks winner! That solved the color problem.
Any takers on the "assinging y-axis to correct curve" case?
0 Kudos
Message 3 of 6
(4,567 Views)

Hi salte,

There is a channel parameter called "D2AxisPairNo" which you can use to assign a particular curve to an existing Y axis.

Ask if you have further questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 6
(4,555 Views)
Thanks, that was what i was looking for.
0 Kudos
Message 5 of 6
(4,539 Views)

Is there an updated way to assign a channel you've imported to the X or Y axis in DIADEM 2022? I'd like to assign my imported channel to the time axis to use that data as my time value.

0 Kudos
Message 6 of 6
(1,174 Views)