Hi @Neo ,
I'm not sure if I understand your issue entirely, but here's how I've interpreted it to come up with what I think is a solution. First off, It's clear you don't want to change the table structure, which is understandable, especially if you're designing this to be run as an automated JSL script or something.
The below JSL script is ONE way to do it. I'm sure there are many others, but it at least gets you in the right direction, where you can now edit it as you wish, for color, style, etc. It might not be exactly what you're after, but I think it should be close.
Names Default To Here( 1 );
dt = Data Table( "egDataTable" );
dt << New Column( "Median1", Continuous, Numeric );
dt << New Column( "Median2", Continuous, Numeric );
For( i = 1, i <= N Rows( dt ), i++,
If(
:TestParameter[i] == "Id1" & :TestStage[i] == 1,
:Median1[i] = :Median[i];
_LSL1_ = :LSL[i];
_USL1_ = :USL[i];,
:TestParameter[i] == "id2" & :TestStage[i] == 2,
:Median2[:PartNumber[i]] = :Median[i];
_LSL2_ = :LSL[i];
_USL2_ = :USL[i];,
.
)
);
Graph Builder(
Graph Spacing( 4 ),
Variables( X( :Median1 ), Y( :Median2 ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
SendToReport(
Dispatch(
{},
"Median1",
ScaleBox,
{Min( 0 ), Max( 1.1 ), Inc( 0.2 ), Minor Ticks( 1 ), Add Ref Line( _LSL1_, "Solid", "Blue", "LSL1", 1 ),
Add Ref Line( _USL1_, "Solid", "Blue", "USL1", 1 )}
),
Dispatch(
{},
"Median2",
ScaleBox,
{Min( -0.03 ), Max( 0.8 ), Inc( 0.1 ), Minor Ticks( 0 ), Add Ref Line( _LSL2_, "Solid", "Blue", "LSL2", 1 ),
Add Ref Line( _USL2_, "Solid", "Blue", "USL2", 1 )}
),
Dispatch( {}, "400", ScaleBox, {Legend Model( 3, Properties( 0, {Marker( "Star" )}, Item ID( "Median2", 1 ) ) )} )
)
);
Hope this helps!,
DS
*Edit: One thing I meant to mention is that if you want to generalize this for working with other kinds of data tables, you might want to consider having consistency across labels, for example, your TestParameter column has mix of lower and upper case, e.g. Id1, id2, id3, instead of all being ID#, or id#, etc. When doing the conditional coding, it's sometimes a lot easier when you have consistent syntax so there's less chance of having to debug because of letter case.