I have problem with QCustomPlot libarary. I made program where user inputs formula and x values then program calulates y values and displays them in nice table.
After that program uses x values and calculated y values to draw quadratic function. But instead of drawing curve it draws sharp lines. Like statistical diagram or somethink like that.
I would like to know how i can covert those for example
x- -1, -2, 1, 2, 0
y - -0.5, -0.25, 0.5, 0.25, 0
to a quadratic function.
if you need here is code where I draw graph.
kiek = 0;
//limitas is just counter which counted how many times user typed values
// user typed x values and calculated values are stored in double type array
QVector<double> x(limitas), y(limitas);
for(int z= 0; z<limitas; z++){
x[z] = iksai[kiek];
y[z] = d[kiek];
kiek++;
}
ui->customPlot->addGraph();
ui->customPlot->graph(0)->setData(x, y);
max = *std::max_element(d, d + limitas);
max1 = *std::max_element(iksai, iksai + limitas);
min1 = *std::min_element(d, d + limitas);
min = *std::min_element(iksai, iksai + limitas);
ui->customPlot->xAxis->setRange(min, max1);
ui->customPlot->yAxis->setRange(min1, max);
ui->customPlot->replot();