Plotting Graph in Qt



  • [Thread locked. Duplicate of http://forum.qt.io/topic/67561 --JKSH]

    How to plot graph in real time by asking inputs to user, and how to input x[] and y[] set values before calling setData(x,y).

    int x1 = ui->x1->text().toInt();
    int y1 = ui->y1->text().toInt();
    int x2 = ui->x2->text().toInt();
    int y2 = ui->y2->text().toInt();

    what I need to make to join these 2 points i.e p1(x1,y1) and p2(x2,y2)

    then I can call the function
    ui->customPlot->addGraph();
    ui->customPlot->graph(0)->setData(x, y);


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.