[Interest] Qt Charts questions

Murphy, Sean smurphy at walbro.com
Thu Jan 4 22:59:06 CET 2018


> I noticed that too, but unlike a lot of Qt mailing list topics, they more or less

> "just work" and are "as-is" due to the clear and limited scope.



I find that they work well if you're just trying to have one plot, but I'm struggling to get

them to work the way I need them to for our requirements:



We have a working application that currently uses Qwt for plotting, but I'd like to see if

I can swap out Qwt (http://qwt.sourceforge.net) for QtCharts. The sticking point I'm

having is this combination of requirements:

1. We're sampling a variety of sensors periodically. The value ranges of the individual

  sensors span very different ranges. For example, one sensor ranges from 0 - 65535,

  and a different sensor may only go from 0 - 1.

2. Because all of the sensors are sampled at the same time, the x-axis of the plot

  is just time, and the y values are the sensor readings at that given moment in time

3. Since (I think?) you can only reasonably have two y-axis scales (one on the left,

  one on the right) per plot, and our sensor value ranges are so varied, we can't reasonably

  put all the sensors on one plot and set the y-axes scales to the largest range because

  then you can't see the details of sensor(s) whose values don't range very far.

4. So because of requirements 1-3, we stack multiple plots vertically - aligning them so

  that I can overlay a vertical cursor line over all plots so the user can see where events from

  one plot line up with events on the other plots. All plots have the exact same x-axis range.

5. Because all of the plots have the exact same x-axis, there's no need to display it on each

  plot, chewing up valuable vertical pixels. So to save pixels in the y dimension, in Qwt we

  hide the x-axis widget on all the individual plots and we instantiate a stand-alone one and

  placed it above the stack of plots, aligning it to the plots (I’ve attached a pic showing it).



I don’t see how to do this with QtCharts since it doesn’t seem like the axes are

widgets/graphicswidgets. They only inherit from QObject, so I don’t know how to get a

standalone one instantiated. I also don’t see any transform functions that allow you to get from

chart x,y coordinates to pixel coordinates so that I could even manually paint my own scale.



Sean




This message has been scanned for malware by Forcepoint. www.forcepoint.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180104/9bcfb42c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verticallyAlignedPlots.png
Type: image/png
Size: 17613 bytes
Desc: verticallyAlignedPlots.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180104/9bcfb42c/attachment.png>


More information about the Interest mailing list