In Qt, a simple graph is implemented using QChart. During the work, it became necessary to scale along the X axis, it was decided to implement using QtCharView, and specifically QChartView :: RubberBand.

graph1 = new QChart; QChartView *graph1View = new QChartView(graph1); ui->widget->setChart(graph1); // связь графика с элементом отображения graph1->setTitle("Исходный сигнал"); graph1->setAnimationOptions(QChart::AllAnimations); graph1View->setRubberBand(QChartView::HorizontalRubberBand); 

Judging by the documentation from the Qt website, this should be enough to activate scaling, however, this does not happen. Charts are displayed, primitive scale animation when the window is resized is also present, but scaling is not. Doubts creep in that it is necessary to use the mouse, more precisely, to describe the events by action with it. Maybe someone has already encountered or implemented this, I will be glad to help!

    0