qtqcustomplot

Ignore time gaps in QCPFinancial


When feeding the QCPFinancial chart from QCustomPlot (http://www.qcustomplot.com) with data which has gaps (weekends, nights without trading) then these gaps are visible along the x-axis in the chart as well.

Is there a way to tell QCPFinancial to ignore missing x-values so that for instance price on Monday is directly plottet after price from Friday?

Regards,


Solution

  • According to QCustomPlot forums (https://www.qcustomplot.com/index.php/support/forum/670), currently there's no any built-in functionality for this.

    General workaround seems to be something like this:

    1. Substitue "key" values with actual continuous data (one may use just plain integer indexes 0..N).

    2. [Optional] Save a "mapping" to and from original key values.

    3. [Optional] Subclass QCPAxisTickerDateTime (or general QCPAxisTicker) and implement custom method for creating tick labels, using previously mapped keys.