Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Scroll bar for QChartView

Scroll bar for QChartView

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alexandra
    wrote on last edited by
    #1

    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 example

        QApplication 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.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alexandra
      wrote on last edited by
      #2

      A possible solution is described in the example https://www.qcustomplot.com/index.php/tutorials/specialcases/scrollbar

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved