[Interest] Handling zooming in QtCharts

Lorne Sturtevant dragor at shaw.ca
Tue Jun 21 07:00:33 CEST 2016


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




More information about the Interest mailing list