QCustomPlot Discussion and Comments

The problem with rebuilding financial charts demoReturn to overview

Hi.
I use financial charts demo. http://www.qcustomplot.com/index.php/demos/financialchartsdemo
When I call
ui->customPlot->clearPlottables();
and after re-build, lower chart QCPBars *volumePos,QCPBars *volumeNeg not built.
How to correct it?

clearPlottables only removes all plottables (graphs, financial charts, bars, etc.). but does not change the layout (this would be customPlot->plotLayout()->clear()).
So if you then call the setup code of the financial charts demo again, it adds more layout elements (axis rects) to the already existing ones. That's probably not what you want. So I recommend setting up the layout once, and then only operating on the plottables (remove the corresponding layout manipulation code from the financial charts demo).
For further reading I recommend
http://www.qcustomplot.com/documentation/thelayoutsystem.html

If I use customPlot->plotLayout()->clear(), then my program turns off.
How can I create :
QCPBars *volumePos = new QCPBars(volumeAxisRect->axis(QCPAxis::atBottom), volumeAxisRect->axis(QCPAxis::atLeft));
QCPBars *volumeNeg = new QCPBars(volumeAxisRect->axis(QCPAxis::atBottom), volumeAxisRect->axis(QCPAxis::atLeft));,
without more layout elements?

It works, thank you