void PlotWindow::setupRealtimeDataDemo(QCustomPlot *customPlot) { customPlot->addGraph(); // blue line customPlot->graph(0)->setPen(QPen(Qt::blue)); customPlot->graph(0)->setBrush(QBrush(QColor(240, 255, 200))); customPlot->graph(0)->setAntialiasedFill(false); customPlot->addGraph(); // blue dot customPlot->graph(1)->setPen(QPen(Qt::blue)); customPlot->graph(1)->setLineStyle(QCPGraph::lsNone); customPlot->graph(1)->setScatterStyle(QCPScatterStyle::ssDisc); customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime); customPlot->xAxis->setDateTimeFormat("hh:mm:ss"); customPlot->xAxis->setAutoTickStep(false); customPlot->xAxis->setTickStep(2); customPlot->axisRect()->setupFullAxesBox(true); customPlot->yAxis->setRange(-80,80); }