Here is the best I could do. It required a table change to allow for Graph Builder to have separate X axes for each product.
Names Default To Here( 1 );
dt = Data Table( "Table1" );
dt << New Column( "PM2 date",
formula( If( :Product == "PM2", :Date, . ) ),
Format( "m/d/y h:m:s" )
);
dt << New Column( "PM3 date",
formula( If( :Product == "PM4", :Date, . ) ),
Format( "m/d/y h:m:s" )
);
dt << New Column( "PM4 date",
formula( If( :Product == "PM2", :Date, . ) ),
Format( "m/d/y h:m:s" )
);
dtRefLineDef = Data Table( "Table2" );
Graph Builder(
Size( 534, 464 ),
Show Control Panel( 0 ),
Variables( X( :PM2 Date ), X( :PM3 Date ), X( :PM4 Date ), Y( :Yield ) ),
Elements(
Position( 1, 1 ),
Points( X, Y, Legend( 9 ) ),
Smoother( X, Y, Legend( 10 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y, Legend( 11 ) ),
Smoother( X, Y, Legend( 12 ) )
),
Elements(
Position( 3, 1 ),
Points( X, Y, Legend( 13 ) ),
Smoother( X, Y, Legend( 14 ) )
),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model(
9,
Properties( 0, {Line Color( 0 )}, Item ID( "Yield", 1 ) )
), Legend Model(
10,
Properties( 0, {Line Color( 0 )}, Item ID( "Smooth", 1 ) )
), Legend Model(
11,
Properties( 0, {Line Color( 0 )}, Item ID( "Yield", 1 ) )
), Legend Model(
12,
Properties( 0, {Line Color( 0 )}, Item ID( "Smooth", 1 ) )
), Legend Model(
13,
Properties( 0, {Line Color( 0 )}, Item ID( "Yield", 1 ) )
), Legend Model(
14,
Properties( 0, {Line Color( 0 )}, Item ID( "Smooth", 1 ) )
)}
),
Dispatch( {}, "400", LegendBox,
{Legend Position(
{9, [-1], 10, [-1], 11, [-1], 12, [-1], 13, [-1], 14, [-1]}
)}
)
)
);
gbr = Current Report();
For( i = 1, i <= N Rows( dtRefLineDef ), i++,
If(
dtRefLineDef:Product[i] == "PM2", box = 1,
dtRefLineDef:Product[i] == "PM3", box = 3,
dtRefLineDef:Product[i] == "PM4", box = 4
);
gbr[axisbox( box )] << add ref line(
dtRefLineDef:Design Change Dates[i], "Solid", "Black",
dtRefLineDef:Design Name[i]
);
);
Jim