Results 1 to 14 of 14

Thread: QML ChartView updates

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QML ChartView updates

    I don't know what to tell you. When you build and run something under Qt Creator, you are running in a different environment than on the actual device (or in a test bed or on your desktop). Paths are different, the "current directory" is different, and so forth. "QAbstractSeries" is probably defined in a QML file associated with the Qt Charts package, and either you aren't deploying that file on iOS or you aren't deploying it in a search path that QML is using on iOS.

    On my 5.4.1 distribution, "QAbstractSeries" is defined in the qabstractseries.h file down in the Charts source tree, and is referenced as a Component in the plugins.qmltypes file in the chartsqml2 directory.

    Have you followed the instructions on Deploying QML Applications?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    Seems that the overall issue was running in Debug mode. Once I switched to a Release mode on iOS, the QAbstractSeries error went away... and the charts worked.

  3. #3
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    I know it's been a while, but I wanted to update this thread with how I ended up getting this to work best on iOS and Android...

    I use the QML charts, and am dynamically updating them by doing a 'remove' followed by and 'append'. I have 4 charts, 3 of which have a single series, and one which has 2 series.

    I define the each series at Chart creation, the populate the entire series with data from a MySQL DB... then as new data is added to the DB, I do this for each series ( as appropriate ):

    Qt Code:
    1. series1.remove(0);
    2. series1.append(incomingData.msec,incomingData.dataPoint);
    To copy to clipboard, switch view to plain text mode 

    This removes the first item from the series (the oldest), and appends the newest item as the last in the series... works like a charm.

    I was originally destroying and recreating each series... which worked, but this way is cleaner and is less effort.

    I would assume that since I can do this via QML, you could do it via C++.

    --Sam

  4. The following 2 users say thank you to scgrant327 for this useful post:

    anda_skoa (15th February 2017), d_stranz (14th February 2017)

  5. #4
    Join Date
    Sep 2015
    Posts
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QML ChartView updates

    Quote Originally Posted by scgrant327 View Post
    I know it's been a while, but I wanted to update this thread with how I ended up getting this to work best on iOS and Android...

    I use the QML charts, and am dynamically updating them by doing a 'remove' followed by and 'append'. I have 4 charts, 3 of which have a single series, and one which has 2 series.

    I define the each series at Chart creation, the populate the entire series with data from a MySQL DB... then as new data is added to the DB, I do this for each series ( as appropriate ):

    Qt Code:
    1. series1.remove(0);
    2. series1.append(incomingData.msec,incomingData.dataPoint);
    To copy to clipboard, switch view to plain text mode 

    This removes the first item from the series (the oldest), and appends the newest item as the last in the series... works like a charm.

    I was originally destroying and recreating each series... which worked, but this way is cleaner and is less effort.

    I would assume that since I can do this via QML, you could do it via C++.

    --Sam
    Thanks for this post. It was very helpful.
    I did similar coding in QML, but has an event with new data coming in.
    I append the data to the lineseries during the event, but the chart doesn't get updated.
    I also tried remove then append and it doesn't update to the new data.
    Was there something else you call to cause the chart to get repaint?

    -Qtino

  6. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QML ChartView updates

    I append the data to the lineseries during the event, but the chart doesn't get updated.
    I also tried remove then append and it doesn't update to the new data.
    Are you sure that the line series you are modifying in your slot is the same one you added to the chart, and not some temporary line series you are creating in the slot (which then gets destroyed immediately)?

    Since you haven't showed any of your code, there's no way to tell what you might be doing wrong.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. installing updates
    By uj in forum Installation and Deployment
    Replies: 3
    Last Post: 13th July 2012, 08:15
  2. multithreaded gui updates
    By ugluk in forum Qt Programming
    Replies: 5
    Last Post: 30th September 2011, 17:10
  3. QMenuBar Updates
    By johnmauer in forum Qt Programming
    Replies: 5
    Last Post: 20th January 2010, 13:35
  4. Painting updates
    By QbelcorT in forum Qt for Embedded and Mobile
    Replies: 6
    Last Post: 29th September 2008, 00:48
  5. QDataTable Inserts and Updates
    By ederbs in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 23:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.