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. QChart with several lines : zoom out to show all lines
Forum Updated to NodeBB v4.3 + New Features

QChart with several lines : zoom out to show all lines

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 554 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.
  • N Offline
    N Offline
    Natxo
    wrote on last edited by
    #1

    Hi all!

    My QChart is showing audio data to display it on real time. When the lenght of data reaches the maximum of default X or Y axis, the chart scrolls ( it 'slides' to the left, or to up and down ); so there are momment when the QChart only displays a fraction of the curve.
    Once the data generation has stopped, a new generation process can arrive, so the QChart displays a new curve ( a new series is added to QChart) and the display process re begins as described.

    As QChart may show only a fraction of the curve(s), I'd like to have a function that zooms out to display all the curves in a glance. I've thought of iterating over all the series ( a QList<QAbstractSeries *> ) to get the maximum lenght between them ( to get the X axis max value ) and also to get the maximum and minimum values ( to the max/min values of Y axis ). And the use the QChart's axisY/axisX() functions:

    myQchart->axisX()->setRange(0,maximumLengthAmongSeries);
    myQchart->axisY()->setRange(minValueAmongSeries,maxValueAmongSeries);
    

    But I'm sure i'm missing something because I can't belive there's no implemented function to do this faster.
    Does anyone know a more efficient solution??
    Thank you very much!

    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