QCustomPlot Discussion and Comments

I have a market data series, which continues during the work days, and breaks on weekends. I want to show it uninterrupted, so that periods of "silence" would not show on time axis - they must be cut out, and axis parts "glued" in this regions.

Is it possible to achieve this functionality with QCP?


If you want to keep dates/times as x axis labels, you will probably have to assign own tick marks
(QCPAxis::setTickVector, setTickVectorLabels). Remember to disable auto ticks for this (QCPAxis::setAutoTicks, setAutoTickLabels). This way you can cut out the weekends in your data and compensate for the 2-day-jumps via custom tick marks/labels.

A suitable key coordinate must be found though, which describes your data continuously. I recommend something like "workdays", which just counts upwards in steps of 1 per day and leaves out weekends. Your tick label generation must then be able to generate dates from the workdays coordinate which shouldn't be too hard. Just add 2 days for every 5 workdays (e.g. use the integer division workdays/5 for that) and then use QDateTime::addDays or addSecs if you need sub-day-precision to transform that into a proper QDateTime.

can some body help me how to achieve that using the latest version QCustomPlot? just break the datetime axis into two part.