I'm creating forest plots and have come up with two styles:
I'm trying to control the color of the bars, points and error bars through row colors:
My question is why aren't the solid bars and the error bars in the desired color?
dt = New Table( "Forest Plot", Add Rows( 5 ),
New Column( "EVENT_NAME", Character( 20 ), "Nominal",
Set Values( {"AAAAAAA", "BBBBBBB", "CCCCCCC", "DDDDDDD", "EEEEEEE"} ) ),
New Column( "DISPROP025", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[5.3766744840813, 1.28687381477736, 5.96303490967794, 1.55531597890029, 2.34164191312678] ) ),
New Column( "DISPROP", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[5.76756983251198, 1.49287821887835, 7.02941951612351, 3.83591362397761, 2.62194430908125] ) ),
New Column( "DISPROP975", Numeric, "Continuous", Format( "Fixed Dec", 16, 2 ),
Set Values(
[6.06935482201811, 1.66251397924122, 7.91895228410917, 6.92389142535734, 2.84619058478479] ) ),
New Column( "Alert", Character, "Nominal",
Formula( If( :DISPROP025 > 1 & :DISPROP > 2, "Y", "N" ) ) ),
Set Row States( [13568, 13056, 13568, 13568, 13568] )
);
// Bars + central point
dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME )
),
Elements(
Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Range" ) ),
Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);
// Error bars
dt << Graph Builder(
Show Control Panel( 0 ),
Variables(
X( :DISPROP025 ),
X( :DISPROP, Position( 1 ) ),
X( :DISPROP975, Position( 1 ) ),
Y( :EVENT_NAME )
),
Elements(
Bar( X( 1 ), X( 3 ), Y, Legend( 9 ), Bar Style( "Interval" ) ),
Points( X( 2 ), Y, Legend( 10 ), Jitter( 0 ) )
),
SendToReport(
Dispatch( {}, "DISPROP025", ScaleBox,
{Min( 0 ), Add Ref Line( 1, "Dotted", "Dark Red", "", 2 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch( {}, "EVENT_NAME", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "X title", TextEditBox, {Set Text( "Disproportionality" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "PT" )} )
)
);