QCustomPlot Discussion and Comments

infinite axisReturn to overview

Hi everyone,
I have a graphic with drag and zoom attributes. My x axis is time axis so x axis should start from 0. But my x and y axis is infinite (from minus infinite to plus infinite)
How can I solve this problem?

show me your code


void aesk_gui::on_graph1_cb1_clicked()
{

    if(ui->graph1_cb1->isChecked())
    {

        ui->graph1->xAxis->setLabel("time");
        ui->graph1->yAxis->setLabel("data1");
        ui->graph1->setInteraction(QCP::iRangeDrag,true);
        ui->graph1->setInteraction(QCP::iRangeZoom,true);
        ui ->graph1->addGraph();
        ui ->graph1->graph(ctr1)->setSelectable(QCP::SelectionType(true));
        ui ->graph1->graph(ctr1)-> setPen(pen);
        ui ->graph1->graph(ctr1)-> setData(x_time,data1);
        ui->graph1->graph(ctr1) ->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle));
        ctr1++;

    }
    else
    {
        ui->graph1->clearGraphs();

    }
}











did you set xAxis's tickertype and range