How do I move the plot to the end?

Screenshot%20(6)_LI

Because the data to plot is lastp-1, less than BarCount-1; therefore, there is a lot of blank space behind the chart. How can I remove the blank space and move the plot to the end of the chart? I try the following code to NULL the data then re-assign again but not success:

C = Null; O = Null; H = Null; L = Null;
for ( p = 0; p <= lastp-1; p++ )
{
	C[p] = RKCx[p] ;

	O[p] = RKOx[p] ;

	H[p] = Max( C[p], O[p] );

	L[p] = Min( C[p], O[p] );
}

Use REF

https://www.amibroker.com/guide/afl/ref.html

Also check