Serial Plotter to Elegoo TFT screen

Hi, i am able to display data on the serial plotter however i'm having issues in adding it on to my elegoo display screen. I only have one output pin which the serial plotter is able to draw based on that. However i want to put it on screen but finding it difficult. I have drawed a box and a line in between but getting the wave to draw on it is difficult. Here is my current code based trying to get it work -

unsigned long testFastLines(uint16_t color1, uint16_t color2) {
 unsigned long start;
 int           x, y, w = tft.width(), h = tft.height();

 tft.fillScreen(WHITE);
 start = micros();
 for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, BLACK);
 for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, BLACK);

 tft.drawLine(15,35000, 118,600,RED);


 return micros() - start;
 
}

The red line goes in the middle of screen. Is there anything i can go from to get the serial plotting data to be displayed on that.

It is similar to this but only one wave - TFT LCD Acclerometer GRAPHING Arduino Project! - YouTube

Thanks

and a line in between

Between Mars and Jupiter? Or was there some other planet involved?

The red line goes in the middle of screen.

That's hard to tell when you use magic numbers that are not explained.

Is there anything i can go from to get the serial plotting data to be displayed on that.

You need 4 pieces of information to draw a line - the x coordinate of one point, the y coordinate of that point, the x coordinate of the second point, and the y coordinate of the second point.

What do your x coordinates correspond to? Time?

What do your y coordinates correspond to? The mysterious sensor reading?

Typically, a graph is a series of lines connecting the newest point to the previous point. How are you tracking the previous point?

Never mind I got it to work but thanks for the reply.