c++ - Graphing issues in data output -
i have program taking input external source (right now, joystick), , plotting on graph. graph displays last 60 frames of data, 1-2 seconds. here data input: nextdatapoint(double x){ if (x > max){ max = x; } if (x < min){ min = x; } datainput.enqueue(x) //datainput qqueue<double> while (datainput.size() > 60){ datainput.dequeue(); } update(); //this triggers paint event } here graphing function graph function: //this draws min line , max line qpainter painter(this); int linedist = 25; qpen mypen(qt::black, 3); qpoint maxtext(10,20); painter.drawtext(maxtext, "max"); qpoint maxlineleft(0, linedist); qpoint maxlineright(width(), linedist); painter.drawline(maxlineleft, maxlineright); qpoint mintext(10, height()-10); painter.drawtext(mintext, "min"); qpoint minlineleft(0, height()-linedist); qpoint minlineright(width(), height()-linedist); //this draws actual graph mypen.setcolor(qt::blue); mypen.setwidth(2);...