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. ChartView is too slow

ChartView is too slow

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 715 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.
  • Atr0p0sA Offline
    Atr0p0sA Offline
    Atr0p0s
    wrote on last edited by
    #1

    Hello again :)

    I use QML ChartView to display a big number of points, but it renders them too slowly. For example, it takes ~5 sec for 4500 points and app freezes with 21k points.

    I tried to append points to LineSeries from c++ code but no change.

    I thought it is because ChartView is redrawn every time I add a point, but I set Series.visible to false before adding the points and it didn't work either.

    As far as I understand I can't add points to separate Series and then add this series to ChartView (maybe it would help).

    I don't use c++ charts (as QChartView) because I also want to deploy the app for an android device.

    Can you please suggest a way out of the situation? Or is there only a choice to use custom classes, e.g., based on QSGGeometry?

    1 Reply Last reply
    0
    • Atr0p0sA Offline
      Atr0p0sA Offline
      Atr0p0s
      wrote on last edited by
      #2

      Problem was solved with replace(QList<QPointF> points) in cpp file:

      if (QLineSeries* lineSeries = qobject_cast<QLineSeries*>(series)) {
          lineSeries->replace(m_pointList);
      }
      

      It works really fast even with big numbers of points.

      1 Reply Last reply
      0
      • Atr0p0sA Atr0p0s has marked this topic as solved on
      • A Offline
        A Offline
        aka123
        wrote on last edited by
        #3

        Have yo try to use QSGGeometry?Is it faster?

        Atr0p0sA 1 Reply Last reply
        0
        • A aka123

          Have yo try to use QSGGeometry?Is it faster?

          Atr0p0sA Offline
          Atr0p0sA Offline
          Atr0p0s
          wrote on last edited by
          #4

          @aka123 No, I didn't. ChartView adds points one by one quickly enough, as long as there is no need to add a large number of points at the same time. But in this case, LineSeries's replace() method solves the problem.

          1 Reply Last reply
          0
          • JonBJ JonB referenced this topic on

          • Login

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