I have a derivative question.
If the original graph already has a variable labeled 'Color' and the bar chart color cannot be controlled to be red, what should I do to fix it in order to maintain the red color?
The following JSL should address these two points:
1. Add color() to the variables: Variables(X(:age), Y(:weight), Y(:Column 6, Position(1), Side("Right")), Overlay(:sex),Color("sex")),
2. Change Fill color() to red: Dispatch({}, "400", ScaleBox, {Legend Model(9, Properties(0, {Fill Color("Red"), Transparency(0.2)}, Item ID("Median(Column 6)", 1)))}),
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Column("Column 6", Numeric, "Continuous",
Set Property(
"Axis",
{Show Major Ticks(0), Show Minor Ticks(0), Show Labels(0), Min(0.49),
Max(0.5), Inc(0.2), Minor Ticks(0), Label Row(
{Show Major Labels(0), Show Major Ticks(0), Show Minor Ticks(0)}
)}
),
Formula(
If(:age == 13,
1
,
.
)
);
);
gb = dt << Graph Builder(
Size(712, 621),
Show Control Panel(0),
Variables(X(:age), Y(:weight), Y(:Column 6, Position(1), Side("Right")), Overlay(:sex),Color("sex")),
Elements(Bar(X, Y(2), Overlay(0), Legend(9), Summary Statistic("Median")), Box Plot(X, Y(1), Legend(4))),
SendToReport(
Dispatch({}, "400", ScaleBox, {Legend Model(9, Properties(0, {Fill Color("Red"), Transparency(0.2)}, Item ID("Median(Column 6)", 1)))}),
Dispatch({}, "Y r title", TextEditBox, {Set Text("")}),
Dispatch({}, "400", LegendBox, {Legend Position({9, [2], 4, [0, 1, -3, -3]})})
)
);