@bharathu ,
Hmmmm, the link you provided has the solution if you can read JSL. Below is the referenced link's data drawn using GraphBuilder. and the script. Note near the Comment Line "Shift Two" near the bottom there are two points with similar value and have Notes. The notes run into each other. The Excel example you provided has notes for each point so the comments will collide. You could make thes hover comments, so when you click on a point you can see the comment.
So it is not clear what issues you are having:
- reading Excel,
- creating Graph Builder,
- adding the comment scripts, or
- comment collisions.
Names Default to Here(1);
dt = Open("$DOWNLOADS/Event Lines and Comments on Control Charts.jmp");
gb = dt << Graph Builder(
Size( 742, 456 ),
Show Control Panel( 0 ),
Variables( X( :ID ), Y( :Data ) ),
Elements( Line( X, Y, Legend( 5 ) ), Points( X, Y, Legend( 3 ) ) ),
SendToReport(
Dispatch(
{},
"Data",
ScaleBox,
{Min( -10 ), Max( 25 ), Inc( 5 ), Minor Ticks( 0 ),
Add Ref Line( 10, "Solid", "Medium Dark Green", "UCL", 3 ),
Add Ref Line( 17, "Solid", "Medium Dark Red", "CL", 2 ),
Add Ref Line( 3, "Solid", "Medium Dark Red", "LCL", 2 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Properties(
0,
{Line Color( 1 ), Fill Color( 0 )},
Item ID( "Data", 1 )
)
)}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {3, [-1], 5, [-1]} ), Position( {-1, -1} )}
)
)
);
fb = report(gb)[FrameBox(1)];
fb << Frame Size(1350, 400);
fb << Add Graphics Script(
1,
Description( "Script" ),
For Each Row(
If( Is Missing( :Comment ) == 0,
V Line( Row() );
Text( Right Justified, {Row(), Col Maximum( :Data ) * 1.2},:Comment ))
);
For Each Row(
If( Is Missing( :Note ) == 0,
If( :Data <= Col Mean( :Data ),
Text( Right Justified,{Row(),:Data-:Data*1.1}, :Note ),
Text( Right Justified,{Row(),:Data * 1.1}, :Note )))
);
);
dt << select where(!IsMissing(:Note));
dt << colors(red);
dt << clear select;