QCustomPlot Discussion and Comments

Plot epoch on x axis but see the labels in stringReturn to overview

Hi,

I am trying to plot the data in epoch value using the below code

    ui->chartPlot->xAxis->setRange(1496382380, 1496382390);
    ui->chartPlot->yAxis->setRange(242,245);
    ui->chartPlot->addGraph();
    QVector<double> x(2), y(2);
    x[0]=1496382381;
    x[1]=1496382389;
    y[0]=242.5;
    y[1]=244;
    ui->chartPlot->graph(0)->setData(x, y);

However I want the labels which show up in the chart as string in format of hh:mm:ss. Is this possible? If yes how?

"Plotting date and time data" part of basic plotting tutorial? :)

Absolutely my mistake..it is already there...still adding the code here if people stumble on this question.

   QSharedPointer<QCPAxisTickerDateTime> dateTicker(new QCPAxisTickerDateTime);
    dateTicker->setDateTimeFormat("hh:mm:ss");
    ui->chartPlot->xAxis->setTicker(dateTicker);
    ui->chartPlot->xAxis->setRange(1496382380, 1496382390);
    ui->chartPlot->yAxis->setRange(242,245);
    ui->chartPlot->addGraph();
    QVector<double> x(2), y(2);
    x[0]=1496382381;
    x[1]=1496382389;
    y[0]=242.5;
    y[1]=244;
    ui->chartPlot->graph(0)->setData(x, y);