2 Attachment(s)
How to hide part of a QwtPlot scale?
Hello!
I need to draw some time-based financial data in my QwtPlot but not all the time periods are actually full: when the market is closed, it doesn't produce any data leading to gaps in the graph if a continuous xBottom scale is used. Because of this, financial software usually "hide" this time-gaps, and that is what I need to do.
The problem can be seen in the images below (notice that while in the diary graph the gaps are something like torable, in the 30-minutes based graph the gaps are unacceptable!).
Attachment 8681
Attachment 8682
Notice: the problem with the candle's accumulation has nothing to do with this problem.
I would like to know how could I "edit" the xBottom scale so to cut out this gaps. I have the impression that Seamus had the same problem as presented in the thread [http://www.qtcentre.org/threads/5217...rading-curves], but I simply couldn't understand how he managed to solve his problem.
Thanks for any help,
Momergil
Re: How to hide part of a QwtPlot scale?
In general you need to provide a custom scale for the X axis.
Re: How to hide part of a QwtPlot scale?
The implementation of Seamus uses indexes instead of real dates, where the last value on Friday +1 is the first value on Monday.
Of course then you need a different way how to map values to date time strings for the tick values and you will have the problem that the ticks are not necessarily aligned to date time units.
Another option might be to implement a special type of QwtTransform, that tries to eliminate periods, where no trading happens. I'm not sure how to find such an algo, but the scaleengine example shows how to implement a scale where a special interval is expanded ( "At 400" ). In a a similar way intervals can be shrunk.
Uwe