Hi,
I am trying to use addData function as follows:
void Dialog::setupQuadraticDemo(QCustomPlot *customPlot)
{
demoName = "Faisal Demo";
// generate some data:
double x[100];
double y[100];
//QVector<double> x(501), y(601); // initialize with entries 0..100
for (int i=0; i<100; ++i)
{
x[i] = i/10; // x goes from -1 to 1
y[i] = i/10; // let's plot a quadratic function
}
// create graph and assign data to it:
customPlot->addGraph();
customPlot->graph(0)->addData(x,y);
// give the axes some labels:
customPlot->xAxis->setLabel("x");
customPlot->yAxis->setLabel("y");
// set axes ranges, so we see all data:
customPlot->xAxis->setRange(0, 10);
customPlot->yAxis->setRange(0, 10);
customPlot->replot();
}
and getting the following error:
error: no matching function for call to ‘QCPGraph::addData(double [100], double [100])’
I saw in the QCPCurve class which has QCustom class as friend that this addData is declared like
addData(double,double)
can somebodly plz tell me what's wrong here in the code.
with regards,
Muhammad Faisal.