Results 1 to 4 of 4

Thread: Date Scale for X-Axis

  1. #1
    Join Date
    May 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Date Scale for X-Axis

    Dear all,

    Using Qwt6.0.1, I want to construct a date axis with complete format, i.e showing the beginning of each year as major ticks, months as mid ticks and days as minor tick.
    I know that i should write new QwtScaleDraw and QwtScaleDiv classes, but i really dont know how! Any one can help me please?

  2. #2
    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: Date Scale for X-Axis

    As long as you know your scales you can set the ticks manually using QwtPlot::setAxisScaleDiv.
    More difficult is the situation, when you want to use autoscaling, zooming, panning etc. Then you need to derive a new type of QwtScaleEngine.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    mishani99 (6th September 2011)

  4. #3
    Join Date
    May 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Date Scale for X-Axis

    Can I set different labels for different ticks? f.e. year for major ticks ("yyyy"), month name for medium ticks (f.e 'Aug') & day number ("dd") for minor ticks?

  5. #4
    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: Date Scale for X-Axis

    Only major ticks can have labels,

    Uwe

Similar Threads

  1. Axis Auto Scale
    By gkarthick5 in forum Qwt
    Replies: 3
    Last Post: 13th July 2011, 14:57
  2. Time/Date Axis
    By sigger in forum Qwt
    Replies: 12
    Last Post: 1st May 2011, 10:55
  3. Replies: 4
    Last Post: 16th January 2011, 11:32
  4. Axis with a probability scale
    By Lister in forum Qwt
    Replies: 1
    Last Post: 5th May 2009, 07:45
  5. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 02:12

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.