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. QChartView update problem
Forum Updated to NodeBB v4.3 + New Features

QChartView update problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 603 Views 2 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.
  • O Offline
    O Offline
    o.semmler
    wrote on last edited by
    #1

    Hello,

    I'm trying to connect QAbstractItemModel to QChartView.
    I used the official example: https://doc.qt.io/qt-5/qtcharts-modeldata-example.html

    The problem is that the chart does not update when adding a new row to the model.
    I have tried different ways but without success.

    Can you please advise on how to do this?

    P.S.:
    I found a similar problem here on the forum but nobody solved it:
    https://forum.qt.io/topic/73216/qvxymodelmapper-does-not-update-chart-x-axis

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you show how you are adding data to the model ?

      Also, what version of Qt are you using ?
      On what platform ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MrShawn
        wrote on last edited by
        #3

        Hi,

        Is it that the chart doesn't update or are your not adjusting your axis to have a range where the new data falls into?

        Creating the default axis will provide a range to the axis that fits the data. However the axis range will not change, so if your new data is outside of that range it will appear to not be updating.

        1 Reply Last reply
        0

        • Login

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