Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Update QChart in real time



  • How can I update QChart in real time?
    The QChart is updated only when I remove and add series again, is there any other possibility to do that?
    My code that does not update the chart:

    QChart * tempChart = new QChart();
    QLineSeries * tempSeries = new QLineSeries();
    //...
    tempSeries->append(elapsedTimer->elapsed()/1000, temp);
    

    Code that updates the chart:

    QChart * tempChart = new QChart();
    QLineSeries * tempSeries = new QLineSeries();
    //...
    tempChart->removeSeries(tempSeries);
    tempSeries->append(elapsedTimer->elapsed()/1000, temp);
    tempChart->addSeries(tempSeries);
    


  • Updating the axis solved the problem.



  • Updating the axis solved the problem.


Log in to reply