How to enable scaling in QtCharts?

I want to be able to scale my QtCharts with the mouse.

The best way to scale with the mouse is to draw rectangles and adjust the view to a new smaller rectangle.

How can I implement this in QtCharts?

Highcharts has a very similar example, and it looks pretty good:

enter image description here

+4
source share
1 answer

This feature is provided by QChartView.

QChartView v;
v.setRubberBand(QChartView::HorizontalRubberBand);

There is also a zoom function associated with your mouse. However, I don’t remember which button. Otherwise, use the scaling functions in QChart.

+5
source

Source: https://habr.com/ru/post/1653405/


All Articles