Here is some pretty ugly code, but it seems to provide to you what you need
Names Default To Here( 1 );
dt = Current Data Table();
dt << clear select;
win = New Window( "Test", Outline Box( "", hb = V List Box() ) );
loopstart = Contains( dt << get column names, Column( "A 1" ) );
loopend = (Contains( dt << get column names, Column( "A 2" ) )) - 1;
fluorB3 = Contains( dt << get column names, Column( "B 3" ) );
fluorE3 = Contains( dt << get column names, Column( "E 3" ) );
icounts = (loopend + 1) - loopstart;
For( i = loopstart, i <= loopend, i++,
If( (Column( i ) << get name == "B 1" & fluorB3 > 0) | (Column( i ) << get name == "E 1" & fluorE3 > 0),
If( Column( i ) << get name == "B 1",
fluorcounts = fluorB3,
fluorcounts = fluorE3
);
gb = Graph Builder(
Size( 1517, 788 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Grid Color( "Black" ),
Graph Spacing( 2 ),
Variables( X( :Group ), Y( Eval( i ) ), Y( Eval( i + icounts ) ), Y( Eval( fluorcounts ) ), Color( :Subjects ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 11 ) ), Box Plot( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 12 ) ), Box Plot( X, Y, Legend( 14 ) ) ),
Elements( Position( 1, 3 ), Points( X, Y, Legend( 15 ) ), Box Plot( X, Y, Legend( 16 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "DATA" ), Image Export Display( Normal )} ),
Dispatch( {}, "400", ScaleBox, {Legend Model( 12, Base( 0, 0, 0, Item ID( "Car", 1 ) ) )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Title" )} ),
Dispatch( {}, "X title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( " [%]" ), Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y 1 title", TextEditBox, {Set Text( " Count" ), Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y 2 title", TextEditBox, {Set Text( " Fluor" ), Set Font Size( 14 ), Set Font Style( "Bold" )} ),
Dispatch(
{},
"400",
LegendBox,
{font( "Segoe UI", 12, "Plain" ), Orientation( "Vertical" ), Set Wrap( 12 ),
Legend Position(
{11, [0, 1, 2, 3], 13, [-1, -1, -1, -1, -1, -3], 12, [-1, -3, -3, -3], 14, [-1, -1, -1, -1, -1, -3], 15, [-1, -1,
-1, -1, -1, -3], 16, [-1, -1, -1, -1, -1, -3]}
)}
)
)
);
,
gb = Graph Builder(
Size( 1500, 900 ),
Show Control Panel( 0 ),
Grid Color( "Black" ),
Graph Spacing( 2 ),
Legend Position( "Bottom" ),
Variables( X( :Group ), Y( Eval( i ) ), Y( Eval( i + icounts ) ), Color( :Subjects ) ),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 11 ) ), Box Plot( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 12 ) ), Box Plot( X, Y, Legend( 14 ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "DATA" ), Image Export Display( Normal )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Title" )}, {Set Font Size( 16 )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" ), Set Text( " [%]" )} ),
Dispatch( {}, "Y1 title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" ), Set Text( " Count" )} ),
Dispatch( {}, "X title", TextEditBox, {Set Font Size( 14 ), Set Font Style( "bold" )} ),
Dispatch(
{},
"400",
LegendBox,
{Set wrap( 12 ), Set Title( "" ), font( "Segoe UI", 12, "Plain" ), Legend Position(
{11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1], 13, [-1], 12, [-1], 14, [-1]}
), Orientation( "Vertical" )}
)
)
)
);
hb << Append( Report( gb ) << child );
hb << append( Page Break Box() );
gb << close window;
);
Jim