Results 1 to 3 of 3

Thread: How to hide part of a QwtPlot scale?

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default 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!).
    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 [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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    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
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    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.

    Uwe

Similar Threads

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

Tags for this Thread

Bookmarks

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.