Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Update QChart in real time

Update QChart in real time

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 409 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • michalt38M Offline
    michalt38M Offline
    michalt38
    wrote on last edited by
    #1

    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);
    
    1 Reply Last reply
    0
    • michalt38M Offline
      michalt38M Offline
      michalt38
      wrote on last edited by
      #2

      Updating the axis solved the problem.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved