You could check if your accelleration tag is different than the row before it, something like this:

Names default to here( 1 );
dt = New Table( "Position Data",
Add Rows( 1000 ),
New Column( "Time", Numeric, "Continuous", Format( "Best", 12 ),
Formula( Row() ) ),
New Column( "Position", Numeric, "Continuous", Format( "Best", 12 ),
Formula( Sine( :Time / 20 ) ) ),
New Column( "Speed", Numeric, "Continuous", Format( "Best", 12 ),
Formula( Dif( :Position ) ) ),
New Column( "Acceleration", Numeric, "Continuous", Format( "Best", 12 ),
Formula( Dif( :Speed ) ) ),
New Column( "Is Accel", Numeric, "Continuous", Format( "Best", 12 ),
Formula( ( :Acceleration - Lag( :Acceleration, 1 ) ) > 0 ) ),
New Column( "Start Accel", Numeric, "Continuous", Format( "Best", 12 ),
Formula( If( :Is Accel == 1 & Lag( :Is Accel, 1 ) == 0, 1, 0 ) ) ),
New Column( "Accel Count", Numeric, "Continuous", Format( "Best", 12 ),
Formula( Col Cumulative Sum( :Start Accel ) ) )
);
dt << Graph Builder(
Size( 522, 627 ),
Show Control Panel( 0 ),
Variables(
X( :Time ),
Y( :Start Accel ),
Y( :Acceleration ),
Y( :Speed ),
Y( :Position ),
Overlay( :Accel Count )
),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 66 ) ) ),
Elements( Position( 1, 2 ), Line( X, Y, Legend( 67 ) ) ),
Elements( Position( 1, 3 ), Line( X, Y, Legend( 68 ) ) ),
Elements( Position( 1, 4 ), Line( X, Y, Legend( 69 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
67,
Base( 0, 0, 0 ), Base( 1, 0, 0 ), Base( 2, 0, 0 ),
Base( 3, 0, 0 ), Base( 4, 0, 0 ), Base( 5, 0, 0 ),
Base( 6, 0, 0 ), Base( 7, 0, 0 ), Base( 8, 0, 0 )
), Legend Model(
68,
Base( 0, 0, 0 ), Base( 1, 0, 0 ), Base( 2, 0, 0 ),
Base( 3, 0, 0 ), Base( 4, 0, 0 ), Base( 5, 0, 0 ),
Base( 6, 0, 0 ), Base( 7, 0, 0 ), Base( 8, 0, 0 )
), Legend Model(
69,
Base( 0, 0, 0 ), Base( 1, 0, 0 ), Base( 2, 0, 0 ),
Base( 3, 0, 0 ), Base( 4, 0, 0 ), Base( 5, 0, 0 ),
Base( 6, 0, 0 ), Base( 7, 0, 0 ), Base( 8, 0, 0 )
)}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position(
{66, [0, 1, 2, 3, 4, 5, 6, 7, 8], 67, [-1, -1, -1, -1, -1, -1, -1,
-1, -1], 68, [-1, -1, -1, -1, -1, -1, -1, -1, -1], 69, [-1, -1, -1,
-1, -1, -1, -1, -1, -1]}
), Position(
{0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
)}
)
)
);
Edited to fix minor bug.