Nominate our 2022 Qt Champions!

Plotting Graph in Qt

  • [Thread locked. Duplicate of --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->graph(0)->setData(x, y);

Log in to reply