I am trying to make the waveform like Oscilloscope on nextion and arduino. so i don t want to slide of the line.
The past line stay on the screen and new line start from first point as below link.
If x is the horizontal resolution of the display, and y the vertical, you have an array of x elements.
You store each y reading into consecutive elements.
Then during retrace, undraw (plot in the background colour) the previous pixel using the y value from the array, and draw and store the new sample in the same element.
Thank you for your reply but x axis is time on arduino and y axis is readed data by arduino send to nextion.
i can make array just y axis.
would you write basic example
No, the X axis is an array of scaled sample (y value) values
I don't think a Nextion display is the right thing to do that. Nextion Displays are optimised for HMI use, not as displays.