qchartview

How to add a rectangle to a QML ChartView?

眉间皱痕 提交于 2021-02-16 18:22:58
问题 I want to put a number of rectangles as overlays to show regions of interest on a ChartView of ScatterSeries. However when I try to do this it is clearly using a different coordinate system to that of the ScatterSeries as it is drawn in a completely different place. For example the following is intended to draw a rectangle that captures all of the ScatterSeries but it just draws a small green rectangle top left as shown in the screenshot. ChartView { id: view Layout.fillWidth : true Layout

Warning QPainter inside paintEvent [duplicate]

两盒软妹~` 提交于 2019-12-31 06:18:09
问题 This question already has an answer here : paintEvent in QTableView derived class: Paint device returned engine == 0, type: 1 (1 answer) Closed 2 months ago . I tried to draw some more information in QChartView so I re-implement paintEvent virtual void paintEvent(QPaintEvent *event) { QChartView::paintEvent(event); OmenChart *mchr = dynamic_cast<OmenChart *>(this->chart()); if(mchr == nullptr) return; QPainter painter(this); const int labelOffset = 2 + 2; painter.setFont(this->font());

How to add text in plotting area of chartview in qml

倖福魔咒の 提交于 2019-12-25 02:52:19
问题 How do I place text at specific (x,y) locations within the plotting area of a QML ChartView type? For example, I would like to place text at the location XYPoint{x: -3; Y: 20} I don't want to place at window's(x,y), i want to put at plotting area's (x,y) I read documentation,but i don't find any property !!!!!! //ChartView for plotting points ChartView{ id:chrt anchors.fill: parent height: parent.height width: parent.width legend.visible: false backgroundColor: "black" //X- axis ValueAxis{ id

How to map QChart coordinate to QChartView point?

青春壹個敷衍的年華 提交于 2019-12-11 17:36:30
问题 I want to make a rubber band window in QChart, but I don't know how to map a coordinate of QChart to QChartView. e.g. (0, 0) is a QChart coordinate, maybe it in QChartView is (10, 10), how to transform it? I have saw the answer of Get mouse coordinates in QChartView's axis system But it seems like that it is reversed with my requirement. import sys from PyQt5.QtChart import QChart, QChartView, QLineSeries from PyQt5.QtCore import QPointF, QEvent, QPoint, QRect from PyQt5.QtWidgets import

How to insert QChartView in form with Qt Designer?

谁说我不能喝 提交于 2019-11-29 09:20:21
I want to add QChart to the form. But I can't find it in the Widget Box. So I created it in the code. How can I insert it in QWidget or QFrame or something else? I want to set area of that widget in QtDesigner. Option 1: Promoted I suppose you mean inserting a QChartView, because QChartView inherits from QGraphicsView, this would be a good option, for this we do the following: first add QT += charts in the .pro place the QGraphicsView to the design. Right click on the QGraphicsView and select Promote to... When doing the above, a menu appears, in the menu it should be set in QChartView in

How to insert QChartView in form with Qt Designer?

南楼画角 提交于 2019-11-28 02:39:47
问题 I want to add QChart to the form. But I can't find it in the Widget Box. So I created it in the code. How can I insert it in QWidget or QFrame or something else? I want to set area of that widget in QtDesigner. 回答1: Option 1: Promoted I suppose you mean inserting a QChartView, because QChartView inherits from QGraphicsView, this would be a good option, for this we do the following: first add QT += charts in the .pro place the QGraphicsView to the design. Right click on the QGraphicsView and