PDA

View Full Version : How to properly use setSymbolExtent?



olivier1978
2nd May 2014, 16:20
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:

// as we have one sample per day a symbol width of 12h avoids overlapping symbols

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 (http://www.qtcentre.org/threads/53046-How-to-idenfity-which-move-was-performed-by-a-zoom-event?highlight=setSymbolExtent), but it is still not answered, and that I do not have a QwtScaleWidget.

Hope you could help.

Best regards

Uwe
5th May 2014, 07:35
So, what does 500 and 1000.0 stand for?

In SVN the code looks like this:



// as we have one sample per day a symbol width of
// 12h avoids overlapping symbols. We also bound
// the width, so that is is not scaled below 3 and
// above 15 pixels.

curve->setSymbolExtent( 12 * 3600 * 1000.0 );
curve->setMinSymbolWidth( 3 );
curve->setMaxSymbolWidth( 15 );


I do not have a QwtScaleWidget.
See QwtPlot::axisWidget(...).

Uwe

olivier1978
5th May 2014, 23:03
Thanks Uwe for your reply,

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

Uwe
6th May 2014, 06:13
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