Here is one way to accomplish this. Given a data table
I produced the below chart, using Graph Builder, with Added graphics
Below is the JSL that produced the above graph
Names Default To Here( 1 );
dt = Data Table( "Example" );
gb = dt << Graph Builder(
Size( 648, 450 ),
Show Control Panel( 0 ),
Variables( X( :Month ), Y( :Value ) ),
Elements( Points( X, Y, Legend( 3 ), Error Interval( "Range" ) ) ),
SendToReport(
Dispatch(
{},
"Value",
ScaleBox,
{Min( -8.0923781757601 ), Max( 122.008163265306 ), Inc( 20 ),
Minor Ticks( 0 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
3,
Properties( 0, {Line Color( 16 )}, Item ID( "Value", 1 ) ),
Properties( -1, {Line Color( 16 )}, Item ID( "Jan", 1 ) ),
Properties( -1, {Line Color( 16 )}, Item ID( "Mean", 1 ) )
)}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Previous 5-year average 2023" )}
),
Dispatch( {}, "X title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "400", LegendBox, {Legend Position( {3, [-1, -3]} )} )
)
);
// Add the Circles and Lines
Report( gb )[FrameBox( 1 )] <<
Add Graphics Script(
For Each Row(
If( :Type == "High",
Fill Color( "Gray" );
theHigh = :Value;
theLow = :Value[Row() + 1];
Pen Color( "Gray" );
Pen Size( 4 );
X = Matrix( Floor( Row() / 2 ) ) || Matrix( Floor( Row() / 2 ) );
y = Matrix( theHigh ) || Matrix( theLow );
Line( X, Y );
theList = {};
Insert Into( theList, X[1] );
Insert Into( theList, Y[1] );
Circle( theList, 7, "Fill" );
,
Fill Color( "Red" );
theList = {};
Show( Floor( Row() - 1 ) );
Insert Into( theList, Floor( (Row() - 1) / 2 ) );
Insert Into( theList, :value );
Circle( theList, 7, "Fill" );
// Add the numerical value in the circle
Text Color( "White" );
// Subtract a fudge factor to better center the text
theList[2] = :Value - 3;
Text Font( "Segoe UI", 14, "Bold" );
Text( Center Justified, theList, Char( :Value ) );
)
)
);
Jim