Please nominate your Qt Champions for 2021!

Draw a large scrollable plot

  • I m trying to implement a horizontal scrollable plot. You can see a preview on the following gif .
    I would like some advice to improve performance .

    All plot data are loaded into memory. it's not so huge. So that's not the problem.
    Actually, I m drawing the graph inside a huge QPixmap which is displayed into a QScrollArea .
    When I rescale the graph, I have to redraw the pixmap, which can takes some time when I set the pen size higher.
    So, the best way would be to draw only what I see . How to manage scrolling with that ? Do you have any pattern or suggestion ?
    Using QtCharts, I didn't success to manage the scrolling...

    My code is here if you want to help

    alt text

  • I suggest looking into QCustomPlot.

Log in to reply