In 2.1, I'm finding that clear() doesn't do what I expect for QCPBars. If I clear, than add new values, the old data is still there and the new data gets appended. I find two workarounds: (1) call squeeze() after clear or (2) use removeAfter() instead of clear().
Code fragments:
QCPBars *volumeBar;
volumeBar->data()->clear();
volumeBar->data()->squeeze();
volumeBar->data()->removeAfter(0);
volumeBar->addData(key, value);
The data is daily stock volume and the key is time, so everything is after key=0. I have not changed setAutoSqueeze from the default. Is this expected behavior?