06-02-2023 08:16 AM
Hi,
Is there a way to define Y axis channel as variable.
Here the chart has X axis: Time and Y axis: Speed
But in my case, the Y axis name is not fixed. sometime its test1_speed, test2_speed, test3_speed...
so, is it possible to use something like below,
1) Y axis: [1]/type & "_speed"
where "type" is a global variable and that will have a value either test1, test2, test3.... based on condition.
2) Y axis: @@Data.Root.ChannelGroups(1).Channels(type & "_speed")@@
thanks
Durai
Solved! Go to Solution.
06-05-2023 09:13 AM
You can change it in script. I don't think the 2D axis system configuration supports wildcards... Are you working in VIEW or REPORT?
06-05-2023 09:23 AM
Hi gsklyr,
I am trying to do it in report template. since many pages and multiple charts in each page, i am expecting option to do it in report template itself.
regards,
Durai
06-05-2023 09:48 AM - edited 06-05-2023 09:52 AM
Maybe use channel numbers instead of names if you can anticipate their order?
Otherwise you can script changing a curve reference with something like that:
Dim atype: atype = "test1"
Dim o2DAxisSystem, o2DLine
Set o2DAxisSystem = Report.Sheets("Sheet 1").Objects("2DAxis1")
Set o2DLine = o2DAxisSystem.Curves2D.Item(1).Shape
o2DLine.YChannel.Reference = "[1]/" & atype & "_speed"
Here I assume you have a sheet named "Sheet 1" and a 2DAxisSystem in that sheet named "2DAxis1"
EDIT:
Actually this worked:
BUT it only plots the first occurrence it finds! So if I change the order of the channels and put Speed1 on top, it will only plot Speed1
06-07-2023 09:38 AM
As gsklyr has already written, the Y channel can be set by script.
If you want to get along without script, then the curve expansion of REPORT can be used. Set these settings in the Layout Parameters dialog. This will replace the wildcard * in your channel names of the REPORT layout.