I was wondering either it is possible in the QCustomPlot library to change display format of the data on one of the axis. In my application on the X axis I have time in seconds and I would like to display the steps in HH:MM:SS instead. As an alternative I am thinking of changing the display only from seconds to minutes to hours depending on the X lenght and updating the label from Time [s] to [min] to [hour]. But I would avoid that if its possible to do it the way I described. I Would appreciate all help!
When using:
customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
customPlot->xAxis->setDateTimeFormat("hh:mm:ss");
My timeline starts from hour 1 instead of 0: Is there a way to fix this?
You can use
setTickLabelType()
andsetDateTimeFormat
:The format string is built according to the the format string of
QDateTime::toString()
.