Scroll bar for QChartView
Unsolved
General and Desktop
-
Hello. Is there a way to add a scroll bar to QChartView ? Now If the drawn value is out of the axis range the scroll bar does not appear. If I change the size of the window the graph becomes smaller and the scroll bar does not appear. It is possible to set a fixed height to QChart?
I modify a code from the dynamicspline exampleQApplication a(argc, argv); QMainWindow window; Chart *chart = new Chart; QChartView chartView(chart); chartView.setRenderHint(QPainter::Antialiasing); chartView.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); chartView.setDragMode(QGraphicsView::ScrollHandDrag); window.setCentralWidget(&chartView); window.resize(600, 400); window.show(); return a.exec();
Thanks for answers.
-
A possible solution is described in the example https://www.qcustomplot.com/index.php/tutorials/specialcases/scrollbar