Results 1 to 8 of 8

Thread: Drawing plots from sql data using datetime

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Drawing plots from sql data using datetime

    The code translates the dates into milliseconds since Epoch what is correct, when you want to use QwtDateScaleEngine and QwtDateScaleDraw.

    All what is missing is:

    Qt Code:
    1. ui->qwt_plot->setAxisScaleDraw( QwtPlot::xBottom, new DateScaleDraw() );
    2. ui->qwt_plot->setAxisScaleEngine( QwtPlot::xBottom, new QwtDateScaleEngine() );
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    RogerWilco77 (23rd January 2013)

  3. #2
    Join Date
    Jan 2013
    Posts
    4
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Drawing plots from sql data using datetime

    Thanks a lot. It was really simple.
    I tried not to just copy but to understand.
    Well, obviously I would have had to look under QwtPlot and fight my way via setAxisScaleDraw to to the usage of DateScaleDraw...
    Now that I know it, it appears so logial....

Similar Threads

  1. datetime field
    By valgaba in forum Qt Programming
    Replies: 5
    Last Post: 8th August 2012, 11:43
  2. QT Change Handset DateTime
    By javed_alam786 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 4th May 2011, 18:59
  3. Drawing of graph(data structure) !
    By Abeer in forum Newbie
    Replies: 1
    Last Post: 23rd May 2010, 22:47
  4. Replies: 5
    Last Post: 21st March 2009, 10:10
  5. How to get seconds diferences between two datetime
    By gustavedgardo in forum Newbie
    Replies: 1
    Last Post: 4th March 2009, 23:05

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
  •  
Qt is a trademark of The Qt Company.