Replies: 6 comments 11 replies
-
Hi @ullix PyQtGraph certainly does not offer a spedo-meter graphics item out of the box as you've noticed. The primitive shapes you describe don't actually come from pyqtgraph but from Qt itself, specifically from the QPainter draw methods: https://doc.qt.io/qt-5/qpainter.html for a higher level description, check out their QGraphicsView page: https://doc.qt.io/qt-5/qgraphicsview.html All this applies to pyqtgraph. Where pyqtgraph accels is we provide some sane defaults, view areas that scale, and easier ways to pass numpy arrays to plots. Some of the polygons and rectangle drawing has rules for filling as well. For another example of a "custom" graph, check out the Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the helping info. Yes indeed, when one has done a lot with PyQt(5) - as I have - there is clear attractiveness of pyqtgraph! Though QT has its own challenges. I figured out I need to use QPieSeries() with a hole and append slices, add this to a QChart, view this with a QChartView, and then can add this as a widget to a Q-layout. Phew. But it works. Except that QPieSeries has a "feature", which makes it unusable for this purpose. For a speedometer you need an arc roughly beginning in the West, going through North, and ending in east. But QPieSeries has 0 degrees in North, and cannot draw a pie crossing this 0 degrees point! When you want to draw a pie spanning 20 degrees from 350 degrees through 10 degrees, then the resulting arc goes through south, and has a span of 340 degrees! Too bad. Back to matplotlib. |
Beta Was this translation helpful? Give feedback.
-
hi @ullix , I dont think QPieSeries and chart is optimal aproach. what you should search is Gauge widget, and Qt has one ready built-in however in QML ( BTW, I was looking for such kind of gauge widgets for some custom UPS monitoring tool. |
Beta Was this translation helpful? Give feedback.
-
Gauges are technical instruments which come in very different incarnation and for very different purposes. Mine is for the display of count rates from a Geiger counter. As those rates may vary from a low of 10 CPM (Counts Per Minute) up to 100000 CPM, a log scale is an appropriate choice. I finished my gauge to a satisfactory degree , and in the end it is basically a QPainter job with some other Qt sprinkles. So, it took me a detour in getting there - thanks for your guidance. Whether a gauge is something that pg should offer may be debatable. But I am leaning towards @sem-geologist 's perspective. Given that you claim in your docu's first intro-paragraph: "... and 2) to provide tools to aid in rapid application development " it would seem to me that such tools as a gauge and many others would also be needed for rapid application development! For me the whole thing was valuable despite or perhaps because of the detour. I experimented a bit with pg for plotting data, and, yes, easy enough to start and to get good results. I haven't dug into customization. Mostly because my most relevant graph requires 2 Y-axis with different units, which is, so my understanding, not (yet) possible with pg. I'll keep an eye on the site! |
Beta Was this translation helpful? Give feedback.
-
I agree with everything you said, except your second bullet point: I don't see many existing solutions. But whatever there is, if you could make some place available for them to advertise - in your docu at least - that would be great! I took a peek at the candlestick code and saw Goodness, are you having your own versions of PyQt??? |
Beta Was this translation helpful? Give feedback.
-
I just checked how |
Beta Was this translation helpful? Give feedback.
-
I have a matplotlib problem and on googling stumbled over pyqtgraph. Reading though the docs, I see some exciting opportunities for me. However, in the moment I need something I haven't seen in the docs, neither in the examples.
I need a speedometer like widget / graph, like a classic round instrument with rotating pointer. A linear one would also do. In matplotlib I assemble one by combining wedges and an arrow. In pg I have seen arrows, but nothing like wedges. Not even circles, pies, ovals, rectangles.
Have I missed it or how does one make /use /construct those graph primitives in pg?
Beta Was this translation helpful? Give feedback.
All reactions