I added the total weight for each age to the graph so that the original marks don't show up again.How to modify the code.
Still need to consult an expert.Thanks!
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d2=dt<<Summary(Group(age),sum(height),Freq("无"),Weight("无"),Link to original data table(0));
dt<<Update(With(d2),Match Columns(age=age));
Column(dt, "name") << Label(0);Column(dt, "height") << Label(1);
dt << Select Where(Row() == Col Min(Row(), :age)) << Label(1) << Colors("Red") << Clear Select;
dt << Select Where(Row() == Col Max(Row(), :age)) << Label(1) << Colors("Blue") << Clear Select;
gb = dt << Graph Builder(
Variables(
X( :weight ),
Y( :height ),
Y( :"Sum(height)"n ),
Group X( :age ),
Color( :sex )
),
Elements(
Bar( X, Y, Legend( 5 ), Response Axis( "X" )),
Points(X, Y, Color(0), Legend(7), Summary Statistic("Sum"))
)
,
SendToReport(
Dispatch({"Points"}, "", OutlineBox, {Close(0)}),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
7,
Properties(0, {Marker("Pipe"), Marker Size(0), Transparency(0)}, Item ID("Mean", 1))
)}
)
)
,
Elements(
Position( 1, 2 ),
Bar( X, Y, Legend( 6 ),
Response Axis( "X" ),
Summary Statistic( "Max" ),
Label( "Label by Value" )
)
)
) ;