ChartView and scrollbar
Unsolved
QML and Qt Quick
-
wrote on 26 Dec 2016, 14:51 last edited by
Hi
I couldn't find it in any doc.How to make ChartView scrollable with mouse (finger) when appended data goes out of defined X axis maximum?
-
wrote on 27 Dec 2016, 09:02 last edited by
Have you tried to put it into Flickable {} ?
-
wrote on 27 Dec 2016, 11:17 last edited by
Thanks for clue, but seems like
ChartView
has fixed size.
I addedMouseArea
to handle it - it works like draggingChartView { id: chartView MouseArea { anchors.fill: parent property int lastX: 0 property int lastY: 0 onPressed: { lastX = mouse.x lastY = mouse.y } onPositionChanged: { if (lastX !== mouse.x) { chartView.scrollRight(lastX - mouse.x) lastX = mouse.x } if (lastY !== mouse.y) { chartView.scrollDown(lastY - mouse.y) lastY = mouse.y } } } }
-
wrote on 13 Jan 2017, 04:37 last edited by
Have you tried qchart with graphicsview framework?
-
wrote on 13 Jan 2017, 08:15 last edited by
Yes, in another project.
QGraphicsView
lays a top ofQAbstaractScrollArea
, so scroll bars appears there out of a box. But it requires a few lines of code to add scrolling by drag a scene.
This time I needed QML way.