I'm working with QML Charts. I have now a plot :
import QtQuick 2.9
import QtQuick.Window 2.2
import QtCharts 2.0
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
ChartView {
id: chartView
anchors.fill: parent
theme: ChartView.ChartThemeBrownSand
antialiasing: true
LineSeries {
name: "LineSeries"
XYPoint { x: 0; y: 0 }
XYPoint { x: 1.1; y: 2.1 }
XYPoint { x: 1.9; y: 3.3 }
XYPoint { x: 2.1; y: 2.1 }
XYPoint { x: 2.9; y: 4.9 }
XYPoint { x: 3.4; y: 3.0 }
XYPoint { x: 4.1; y: 3.3 }
}
MouseArea{
anchors.fill: parent
onDoubleClicked: chartView.zoomReset();
}
}
}
I can zoom in and out by using the ZoomIn(QRect)
var r = Qt.rect(x, y, w, h)
chartView.zoomIn(r)
after zooming done i need to move in zoomed plot with pressing middle button (wheel) and shift my place Right or left in chartView.
how i can get pressed middle button position and move ploted series based on that positions ?!
EDIT : middle click option is not important it can be right click . but how to detect it is still pressing and get position of that and set it on ZoomIn(Qrec).