Results 1 to 3 of 3

Thread: How to hide part of a QwtPlot scale?

  1. #1
    Join Date
    Jun 2011
    Porto Alegre, Brazil
    Thanked 2 Times in 2 Posts
    Qt products
    Unix/X11 Windows

    Default How to hide part of a QwtPlot scale?


    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!).
    mShare Export 2013 02 05-17 36 29.jpg
    mShare Export 2013 02 05-17 37 11.jpg

    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 [], but I simply couldn't understand how he managed to solve his problem.

    Thanks for any help,


  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: How to hide part of a QwtPlot scale?

    In general you need to provide a custom scale for the X axis.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

  3. #3
    Join Date
    Feb 2006
    Munich, Germany
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    MacOS X Unix/X11 Windows

    Default 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.


Similar Threads

  1. Replies: 2
    Last Post: 20th July 2012, 13:51
  2. Replies: 2
    Last Post: 30th December 2010, 17:32
  3. Scale MdiSubWindows after Dockwidget hide()
    By Ginsengelf in forum Qt Programming
    Replies: 3
    Last Post: 6th August 2009, 14:00
  4. how to hide the scale in qwt plot
    By babu198649 in forum Qwt
    Replies: 2
    Last Post: 7th March 2008, 06:38
  5. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 08:22

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.