Go to the documentation of this file.
20 double tMin,
double tMax,
double vMin,
double vMax )
22 const double t = sample.
time;
25 const bool isOffScreen = ( t < tMin ) || ( t > tMax )
196 const QColor&
color, qreal width, Qt::PenStyle style )
239 Direction direction,
const QBrush& brush )
242 const int index =
static_cast< int >( direction );
243 if ( index < 0 || index >= 2 )
264 const int index =
static_cast< int >( direction );
265 if ( index < 0 || index >= 2 )
286 extent =
qwtMaxF( 0.0, extent );
369 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
389 const QRectF& canvasRect,
int from,
int to )
const
403 drawSymbols( painter, xMap, yMap, canvasRect, from, to );
422 const QRectF& canvasRect,
int from,
int to )
const
427 double tMin, tMax, vMin, vMax;
430 if ( orient == Qt::Vertical )
457 symbolWidth = std::floor( 0.5 * symbolWidth ) * 2.0;
460 pen.setCapStyle( Qt::FlatCap );
462 painter->setPen( pen );
464 for (
int i = from; i <= to; i++ )
478 const int brushIndex = (
s.open <
s.close )
484 translatedSample.
time = qRound( translatedSample.
time );
485 translatedSample.
open = qRound( translatedSample.
open );
486 translatedSample.
high = qRound( translatedSample.
high );
487 translatedSample.
low = qRound( translatedSample.
low );
488 translatedSample.
close = qRound( translatedSample.
close );
495 drawBar( painter, translatedSample,
496 orient, inverted, symbolWidth );
503 orient, symbolWidth );
512 translatedSample, orient, inverted, symbolWidth );
536 Qt::Orientation orientation,
bool inverted,
double symbolWidth )
const
542 Q_UNUSED( symbolWidth )
564 bool inverted,
double width )
const
566 double w2 = 0.5 * width;
626 const QRectF rect(
sample.
open, t - 0.5 * width,
643 const QSizeF&
size )
const
666 const QRectF& canvasRect )
const
668 Q_UNUSED( canvasRect );
681 double width = qAbs( pos -
map->p1() );
void drawCandleStick(QPainter *, const QwtOHLCSample &, Qt::Orientation, double width) const
Draw a candle stick.
double open
Opening price.
@ NoSymbol
Nothing is displayed.
static void drawRect(QPainter *, qreal x, qreal y, qreal w, qreal h)
Wrapper for QPainter::drawRect()
double invTransform(double p) const
QwtOHLCSample sample(int index) const
virtual void legendChanged()
Base class for plot items representing a series of samples.
A paint device for scalable graphics.
Qt::Orientation orientation() const
double close
Closing price.
void setSymbolPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
virtual void drawSymbols(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
QwtGraphic defaultIcon(const QBrush &, const QSizeF &) const
Return a default icon from a brush.
void setData(QwtSeriesData< QwtOHLCSample > *series)
virtual void drawSeries(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const QWT_OVERRIDE
QwtArraySeriesData< QwtOHLCSample > QwtTradingChartData
Interface for iterating over an array of OHLC samples.
void setSamples(const QVector< QwtOHLCSample > &)
virtual void drawUserSymbol(QPainter *, SymbolStyle, const QwtOHLCSample &, Qt::Orientation, bool inverted, double symbolWidth) const
Draw a symbol for a symbol style >= UserSymbol.
virtual int rtti() const QWT_OVERRIDE
@ Legend
The item is represented on the legend.
double symbolExtent() const
static bool roundingAlignment()
double maxSymbolWidth() const
QWT_CONSTEXPR float qwtMinF(float a, float b)
span_constexpr std::size_t size(span< T, Extent > const &spn)
QwtPlotTradingCurve(const QString &title=QString())
bool testPaintAttribute(PaintAttribute) const
A class representing an interval.
A class representing a text.
@ Decreasing
The closing price is lower than the opening price.
double minSymbolWidth() const
QWT_CONSTEXPR float qwtMaxF(float a, float b)
void setPaintAttribute(PaintAttribute, bool on=true)
void setZ(double z)
Set the z value.
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
void setSymbolExtent(double)
Set the extent of the symbol.
QwtSeriesData< QwtOHLCSample > * data()
double transform(double s) const
virtual void itemChanged()
static bool qwtIsSampleInside(const QwtOHLCSample &sample, double tMin, double tMax, double vMin, double vMax)
virtual size_t dataSize() const QWT_OVERRIDE
QwtPlotTradingCurve::PaintAttributes paintAttributes
void setMaxSymbolWidth(double)
@ ClipSymbols
Check if a symbol is on the plot canvas before painting it.
void drawBar(QPainter *, const QwtOHLCSample &, Qt::Orientation, bool inverted, double width) const
Draw a bar.
QwtPlotTradingCurve illustrates movements in the price of a financial instrument over time.
QwtInterval boundingInterval() const
Calculate the bounding interval of the OHLC values.
SymbolStyle
Symbol styles.
@ Rtti_PlotTradingCurve
For QwtPlotTradingCurve.
void init()
Initialize internal members.
double high
Highest price.
void setSymbolStyle(SymbolStyle style)
void setSymbolBrush(Direction, const QBrush &)
void setItemAttribute(ItemAttribute, bool on=true)
QwtPlotTradingCurve::SymbolStyle symbolStyle
virtual QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
QBrush symbolBrush(Direction) const
SymbolStyle symbolStyle() const
@ Increasing
The closing price is higher than the opening price.
virtual QRectF boundingRect() const QWT_OVERRIDE
virtual double scaledSymbolWidth(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const
void setMinSymbolWidth(double)
virtual ~QwtPlotTradingCurve()
Destructor.
virtual QRectF boundingRect() const QWT_OVERRIDE
Open-High-Low-Close sample used in financial charts.
Direction
Direction of a price movement.
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46