Hello,
I am using graph builder (JMP 17) and have almost what I need. But I need to add a reference line.
This first image ('example') is what I currently have (I need all 3 viruses in 1 graph with lines and dots for the rates for both years).
BUT, I need to add a reference line for each virus so that it looks like 'example with ref line' (below).
I don't know if it is possible. But essentially, I am trying to get a reference line to show up for each one my y-groups. I can use JSL if someone has something that will work using scripts.
Based on what is the reference line plotted from? How does your data look like?
The blue and red lines are my data, but I want to add in a CDC line (which is only available for the year and not monthly like my data) as the green line.
Depending on how your data is formatted, you might be able to add it as a separate line graph or you could add reference lines through scripting.
I don't want it as a separate line graph. I just don't know how to do the script for it.
Is there a specific reason for not wanting separate line graph?
It isn't really a line graph if there is only 1 data point (from the CDC). We just need it as a reference, not part of the actual data.
You can go the complicated way of using graphic script
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Group Y(:sex)),
Elements(Points(X, Y, Legend(11)))
);
fbs = Report(gb) << XPath("//FrameBox");
lines = {60, 65};
For Each({fb, idx}, fbs,
Eval(EvalExpr(
fb << Add Graphics Script(
H Line(Expr(lines[idx]));
);
));
);
or easier option of adding new chart
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << New Column("Line", Numeric, Continuous, << Set Each Value(
If(:sex == "M", 65, 60)
));
gb = dt << Graph Builder(
Size(567, 523),
Show Control Panel(0),
Variables(X(:weight), Y(:height), Y(:Line, Position(1)), Group Y(:sex)),
Elements(Points(X, Y(1), Legend(8)), Line(Y(2), Legend(10)))
);
You can add the horizontal line in Graph Builder. Double-click on the Y axis and put a value in to the reference line section.
But I need to do this for the Y-Group, not the Y-Axis.