Results 1 to 4 of 4

Thread: How to properly use setSymbolExtent?

  1. #1
    Join Date
    Jan 2011
    Location
    Paris
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How to properly use setSymbolExtent?

    Hi all,

    I am wondering hoow to properly use setSymbolExtent on a QwtPlotTradingCurve. I started from the stockchart example, where the value is defined as 12 * 500 * 1000.0 with this comment:
    Qt Code:
    1. // as we have one sample per day a symbol width of 12h avoids overlapping symbols
    To copy to clipboard, switch view to plain text mode 

    So, what does 500 and 1000.0 stand for? How could I use setSymbolExtent to have a "good" view of my candlestick chart? By good I mean no overlapping candles whatever the number of candles is.

    Note that I am aware of this thread, but it is still not answered, and that I do not have a QwtScaleWidget.

    Hope you could help.

    Best regards

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to properly use setSymbolExtent?

    So, what does 500 and 1000.0 stand for?
    In SVN the code looks like this:

    Qt Code:
    1. // as we have one sample per day a symbol width of
    2. // 12h avoids overlapping symbols. We also bound
    3. // the width, so that is is not scaled below 3 and
    4. // above 15 pixels.
    5.  
    6. curve->setSymbolExtent( 12 * 3600 * 1000.0 );
    7. curve->setMinSymbolWidth( 3 );
    8. curve->setMaxSymbolWidth( 15 );
    To copy to clipboard, switch view to plain text mode 
    I do not have a QwtScaleWidget.
    See QwtPlot::axisWidget(...).

    Uwe

  3. #3
    Join Date
    Jan 2011
    Location
    Paris
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to properly use setSymbolExtent?

    Thanks Uwe for your reply,

    I think I understand "3600" (60s * 60m). But what does "1000" stands for ?

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to properly use setSymbolExtent?

    The scale is in milliseconds.

    QwtDate: A double is interpreted as the number of milliseconds since
    1970-01-01T00:00:00 Universal Coordinated Time - also known
    as "The Epoch".
    Uwe

Similar Threads

  1. How to use QOpenGLFunctions_2_1 properly
    By jshafferman in forum Qt Programming
    Replies: 10
    Last Post: 28th March 2014, 21:11
  2. How to properly install QCA on Mac OS?
    By unix7777 in forum Newbie
    Replies: 1
    Last Post: 2nd September 2010, 00:20
  3. Replies: 1
    Last Post: 22nd March 2010, 14:38
  4. How to install Qxt properly?
    By blurboy in forum Newbie
    Replies: 3
    Last Post: 18th October 2009, 20:12
  5. How do I use QTcpSocket properly ?
    By mnemonic_fx in forum Qt Programming
    Replies: 13
    Last Post: 29th March 2007, 20:33

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.