You can fix your graph by changing the Week column to a continuous variable, and then overlaying Animals, and then adding a second line, and ploting it through the mean, but removing the Overlay variable from the definition.
names default to here(1);
dt = New Table( "Example",
Add Rows( 30 ),
New Script(
"Source",
Data Table( "big class" ) << Concatenate(
Data Table( "big class" ),
Data Table( "big class" )
)
),
New Column(
["en" => "name", "ja" => "名前", "x-id" => "S_name_Col", "zh-CN" => "姓名"],
Character,
"Nominal",
Set Property( "Notes", "...usually used as a label variable in plots" ),
Set Values(
{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT",
"BARBARA", "ALICE", "KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM",
"JAMES", "ROBERT", "BARBARA", "ALICE", "KATIE", "LOUISE", "JANE",
"JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA", "ALICE"}
)
),
New Column(
["en" => "age", "ja" => "年齢", "x-id" => "S_age_Col", "zh-CN" => "年龄"],
Numeric,
"Continuous",
Format( "Fixed Dec", 5, 0 ),
Set Property( "Notes", "Explore data adventurously" ),
Set Values(
[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]
)
),
New Column(
["en" => "sex", "ja" => "性別", "x-id" => "S_sex_Col", "zh-CN" => "性别"],
Character( 2 ),
"Nominal",
Set Property( "Notes", "Explore data adventurously" ),
Set Values(
{"F", "F", "F", "F", "F", "M", "M", "M", "F", "F", "F", "F", "F", "F",
"F", "M", "M", "M", "F", "F", "F", "F", "F", "F", "F", "M", "M", "M",
"F", "F"}
)
),
New Column( "Measurement",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Selected,
Set Values(
[89.959512942005, 94.265830994118, 60.9183478215709, 95.2894369501155,
100.92544442974, 72.8645000001416, 90.6610060471576, 80.9968326007947,
110.147639254574, 81.2141562544275, 86.8546054849867, 119.671143941814,
67.2093557997141, 103.23300153017, 72.5169731513597, 70.9814733604435,
90.8327138214372, 63.7885711505078, 107.963811784284, 72.4180357693695,
115.559900880326, 55.6334275682457, 87.0823451085016, 82.9334855871275,
74.3693295912817, 100.173055256018, 105.379759377101, 77.838793330593,
115.123678956879, 64.664425291121]
)
),
Set Label Columns( :name )
);
Graph Builder(
Size( 570, 735 ),
Variables( X( :age ), Y( :Measurement ), Group Y( :sex ), Overlay( :name ) ),
Elements(
Points( X, Y, Legend( 8 ) ),
Line( X, Y, Legend( 9 ) ),
Line( X, Y, Overlay( 0 ), Legend( 10 ) )
),
SendToReport(
Dispatch( {"Line"}, "", OutlineBox, {Close( 0 )} ),
Dispatch(
{},
"age",
ScaleBox,
{Min( 9 ), Max( 13 ), Inc( 1 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
8,
Base( 0, 0, 0, Item ID( "ALICE", 1 ) ),
Base( 1, 0, 0, Item ID( "BARBARA", 1 ) ),
Base( 2, 0, 0, Item ID( "JACLYN", 1 ) ),
Base( 3, 0, 0, Item ID( "JAMES", 1 ) ),
Base( 4, 0, 0, Item ID( "JANE", 1 ) ),
Base( 5, 0, 0, Item ID( "KATIE", 1 ) ),
Base( 6, 0, 0, Item ID( "LILLIE", 1 ) ),
Base( 7, 0, 0, Item ID( "LOUISE", 1 ) ),
Base( 8, 0, 0, Item ID( "ROBERT", 1 ) ),
Base( 9, 0, 0, Item ID( "TIM", 1 ) )
), Legend Model(
10,
Properties(
0,
{Line Color( 0 ), Line Width( 3 )},
Item ID( "Mean", 1 )
)
)}
)
)
)
Jim