問題タブ [qchart]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
255 参照

qt - Detecting all Qt chart series intersecting a selection rectangle

I have a QChart with a number of QLineSeries and QScatterSeries on it. I would like to be able to use the mouse to click-drag a line or a box shape and to detect all series which intersect that box.

I currently have a QGraphicsItem being drawn when I click-drag and I am now trying to detect which series are in that box (note there may be no actual data points in the box, but there may be a section of a line drawn interpolated between 2 data series points).

I don't want to manually detect the intersection by calculating the interpolation points and testing if they are inside my selection box (I'm pretty sure Qt can do this for me), so I'm trying to use the QGraphicsItem::shape() and QGraphicsItem::collidesWith() routines to detect collision. However, I can't seem to get the QGraphicsItem representation of a QLineSeries - is this possible at all?

Would it be better to try and use a QPainterPath? How would I use that in this case?

I also tried to use the hovered(const QPointF &, bool) signal of the data series, so I could record which series were hovered over when the selection box was dragged out, but this signal doesn't fire when the left mouse button is down for some reason. :/

0 投票する
1 に答える
1691 参照

qt - QCharts 右側の 2 番目の Y 軸

ValueAxisの右側に秒を置きたいChartViewドキュメントには、「軸はチャートの下、上、左、または右に配置できます」と記載されています。

AbstractAxisただし、のドキュメントにプロパティが見つからないValueAxisChartView、これに一致します。alignmentのプロパティのみAbstractAxisが私の注意を引きましたが、これは const であり、QML で変更することはできません。

Invalid property assignment: "alignment" is a read-only property

Multiple Axes Exampleに配置を設定する C++ の方法があることがわかりますが、配置を設定する QtQuick の方法を探しています。ここで何か不足していますか?