QCustomPlot Discussion and Comments

Reploting of layer takes time while reploting the whole chart is fasterReturn to overview

Hi,

I have the following layers.

    ui->chartPlot->addLayer("graph_layer",ui->chartPlot->layer("grid"), QCustomPlot::limAbove);
    ui->chartPlot->layer("graph_layer")->setMode(QCPLayer::lmBuffered);

   ui->chartPlot->addLayer("rectangle_layer",ui->chartPlot->layer("grid"), QCustomPlot::limAbove);
    ui->chartPlot->layer("rectangle_layer")->setMode(QCPLayer::lmBuffered);

When I add QCPItemRect to a "rectangle_layer" and then try to replot the layer using
ui->chartPlot->layer("rectangle_layer")->replot(); the graph_layer component freezes and the updations donot happen.

However when I just reploy the whole layer using ui->charPlot->replot() the chart is refreshed without any lag.

Why is this happening?

Hard to say without seeing any of your other code. Do you have any other events tied to replotting? Realtime update of data? When you debug into the "frozen" state, what is being executed? Do you have OpenGL mode enabled? (because some graphics card drivers are notoriously slow with frame buffer objects)