Results 1 to 3 of 3

Thread: Update axes in QLineSeries

  1. #1
    Join Date
    Jun 2018
    Posts
    17
    Thanks
    4
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Update axes in QLineSeries

    I have a function that updates the X and Y ranges in real time and allows to visualize all the data of 5 QLineSeries. This function works correctly when I graph 5 QLineseries in a single window, but it works incorrectly when I add other QLineSeries in other windows (see image). I have observed that the X axis does not have this problem, but I suppose it is because the data in the X axis are the same in all the windows (I graphic in each window against time). My question is, how can I correctly update the Y axis of each window?

    void setRange(QChart *mChart, qreal xValue, QVector<double> yValue)
    This function receives the QChart of the window where the QLineSeries are plotted, the data of the X axis and a vector with the minimum and maximum value of the Y axis. I thought that with the QChart of each window it was enough to update the Y axis of each window , but I think that is not enough.
    Thanks for help me.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    3,929
    Thanks
    229
    Thanked 615 Times in 605 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Update axes in QLineSeries

    You will have to post enough of your code so that we can see what you are doing and hopefully find what you are doing wrong. It isn't even apparent from your screen shots what you think is wrong. It looks like 4 perfectly good plots to me.
    <=== 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.

  3. The following user says thank you to d_stranz for this useful post:

    Eduardo Huerta (19th December 2018)

  4. #3
    Join Date
    Jun 2018
    Posts
    17
    Thanks
    4
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Update axes in QLineSeries

    Quote Originally Posted by d_stranz View Post
    You will have to post enough of your code so that we can see what you are doing and hopefully find what you are doing wrong. It isn't even apparent from your screen shots what you think is wrong. It looks like 4 perfectly good plots to me.
    Thanks I solved the problem, it was a global variable that was incorrect.

Similar Threads

  1. [SOLVED]QLineSeries extremely slow
    By NicolasCasime in forum Qt Programming
    Replies: 2
    Last Post: 23rd May 2018, 17:12
  2. Multiple colors QLineSeries in QtCharts
    By cmartinezdemorentin in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2017, 17:04
  3. Axis or Axes?
    By Momergil in forum Qwt
    Replies: 1
    Last Post: 21st May 2014, 21:10
  4. Help with axes, again! :(
    By bigjoeystud in forum Qwt
    Replies: 2
    Last Post: 15th October 2012, 21:46
  5. Zoom and pan with two y-axes
    By mjfj in forum Qwt
    Replies: 1
    Last Post: 19th October 2010, 11:39

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.