QCustomPlot Discussion and Comments

How to get the data back from graph ?Return to overview

I am setting the data by the following command

chart->graph(live_graph_index)->addData(*timeValue, *priceValue);

Is there any method to get the data from the graph as well?

Something like this:
QVector<double> key=chart->graph(live_graph_index)->getAllKeyData()
QVector<double> values=chart->graph(live_graph_index)->getAllValueData()

QSharedPointer<QCPGraphDataContainer> QCPGraph::data() const

that has

const_iterator constBegin() const { return mData.constBegin()+mPreallocSize; }
const_iterator constEnd() const { return mData.constEnd(); }

when mData is

QVector<DataType> mData;

and DataType is

class QCPGraphData
  double key, value;