PDA

View Full Version : How to avoid having week-ends "gaps" while plotting a stockchart with intraday sample



olivier1978
2nd May 2014, 16:27
Hi all,

I use a QwtPlot to plot some prices as candlesticks. However, my application has the ability to plot intraday data (hourly, m15, ...). Thus, it is possible that they are in the samples prices goind from friday to monday. When this happens, there is a gap is the plot (since there is no data for the week-end). I am wondering how I can remove this gap.

Do you have any hint?

Hope you could help

Bets regards

Uwe
5th May 2014, 07:49
Then you can't use the scale system implemented in QwtDate and the QwtDateScaleEngine/QwtDateScaleDraw. Instead:



you have to define a mapping between your dates and coordinates ( doubles ) without gaps.
you have to find a way how to set the ticks of the scales at positions, that make sense for your dates. You can set them manually ( QwtPlot::setAxisScaleDiv() ) or you have to implement your own type of scale engine.


Uwe