Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. how to display huge amount data in qml chartview LineSeries?

how to display huge amount data in qml chartview LineSeries?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 532 Views 1 Watching
  • 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.
  • P Offline
    P Offline
    Peter321123
    wrote on last edited by Peter321123
    #1

    Hello all,

    I am trying to display 10 LineSeries in qml chartview with DateTimeAxis,with C++ to update the data every 1 second.
    The problem is that: when the data grow the qml UI get slowly, and the process crashed.

    top_Qt_5_14_0_MinGW_64_bit-Debug\dc_beta.exe crashed.

    e.g. for 15days, the points will be 3600 * 24 * 15=1296000
    the data saved in qml UI side(memory)?

    following code is to explain what I'm doing:
    (1)//Mychartview.qml
    ChartView {

    DateTimeAxis{
    id:idX
    ...
    }
    ValueAxis{id:idY1}
    LineSeries{id:lineCH1; axisX:idX; axisY:idY1;}

    Timer
    {
    //request data from C++ every 1 second
    context.funUpdateDataFrom(chartView.series(0))
    }

    (2)//my.cpp
    funUpdateDataFrom(QAbstractSeries *series)
    {
    static int iTest;
    QXYSeries *xySeries = static_cast<QXYSeries *>(series);
    ...

     xySeries->append(nowTime, iTest++);
    //maybe use replace(mPoints) function,but it need to define a big-size mPoints consuming huge memory.
    

    }

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      This is not sustainable. Cache the data to disk and load n points from this cache. Give yourself the ability to scroll through the data that was collected. Maybe a date time lookup. I like to use sqlite databases for stuff like this and then I just do queries using the qdatabase classes.

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      1

      • Login

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