[Interest] Handling zooming in QtCharts

Alan Ezust alan.ezust at gmail.com
Wed Jun 22 04:36:58 CEST 2016


Because QChart is derived from QGraphicsView, you can also set the
setTransformationAnchor() to

QGraphicsView::AnchorUnderMouse and then scale() it.



On Mon, Jun 20, 2016 at 10:00 PM, Lorne Sturtevant <dragor at shaw.ca> wrote:

> I was able to find a way to zoom centred on the mouse.  What I did was
> make use of the QChart::plotArea() function.  With that function by
> using ChartView::wheelEvent(), I could get where in the chart the zoom
> is happening.  I then did some math and set the new zoom for the chart
> by adjusting the range for the chart's x and y axis.
>
> Fortunately I could do this with the existing API.  It would be nice if
> there was a cleaner API for doing this though.
>
> --
> Lorne Sturtevant
> Sum Ergo Cogito
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160621/ebac82dd/attachment.html>


More information about the Interest mailing list