QCustomPlot Discussion and Comments

clear single graphReturn to overview

Hi,
is it possible to clear a single graph?I use 4 graphs.
When I use remove graph(x), the graph is deleted.When i use clearGraphs(), all graphs are cleared.

after reading some of the former threads I thought:
m_ui->curves->graph(0)->clearData();
is the solution but I get this fault:
'class QcpGraph' has no member named 'clearData'

clearData function is not available in 2.0. use m_ui->curves->graph(0)->data()->clear();

@ Ian
thank you for this hint.
In the meantime I found this solution:
m_ui->curves->graph(0)->disconnect();
what is the difference?

that's not a solution, you're just calling the QObject::disconnect (because QCPGraph derives indirectly from QObject), which removes all signal/slot connections. Doesn't change the data at all.

Sorry,i do not understand this.
I have a graph(0) and want to forward data from one origin(data x), now i want to stop this .
Data is zero (no graph visible), now I want to forward other data (data y) to graph(0), Which version is better?

isso is correct. calling QObject::disconnect is not a solution. basically if that is working for you, you should just call m_ui->curves->graph(0)->setVisible(false).

this does not actually clear the data though. it just sets the graph to not visible.