Your question has been mostly answered, but let's quickly talk about changing the "Chart History length".
I don't see a good reason to change chart history at run time. Simply make it "long enough", then display only parts by modifying the axis scaling programmatically.
If you need full control over the chart history, you can use a waveform
graph, create your own FIFO buffer of adjustable length, and manipulate all scaling programmatically. To the user, it will look exactly like a chart.
😉(It's probably not worth ithe effort.)