Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_tradingcurve.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_PLOT_TRADING_CURVE_H
11#define QWT_PLOT_TRADING_CURVE_H
12
13#include "qwt_global.h"
14#include "qwt_plot_seriesitem.h"
15
37class QWT_EXPORT QwtPlotTradingCurve
38 : public QwtPlotSeriesItem
39 , public QwtSeriesStore< QwtOHLCSample >
40{
41 public:
49 {
51 NoSymbol = -1,
52
60
68
76 UserSymbol = 100
77 };
78
83 {
86
88 Decreasing
89 };
90
96 {
98 ClipSymbols = 0x01
99 };
100
101 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
102
103 explicit QwtPlotTradingCurve( const QString& title = QString() );
104 explicit QwtPlotTradingCurve( const QwtText& title );
105
106 virtual ~QwtPlotTradingCurve();
107
108 virtual int rtti() const QWT_OVERRIDE;
109
110 void setPaintAttribute( PaintAttribute, bool on = true );
111 bool testPaintAttribute( PaintAttribute ) const;
112
113 void setSamples( const QVector< QwtOHLCSample >& );
114 void setSamples( QwtSeriesData< QwtOHLCSample >* );
115
116 void setSymbolStyle( SymbolStyle style );
117 SymbolStyle symbolStyle() const;
118
119 void setSymbolPen( const QColor&,
120 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
121 void setSymbolPen( const QPen& );
122 QPen symbolPen() const;
123
124 void setSymbolBrush( Direction, const QBrush& );
125 QBrush symbolBrush( Direction ) const;
126
127 void setSymbolExtent( double );
128 double symbolExtent() const;
129
130 void setMinSymbolWidth( double );
131 double minSymbolWidth() const;
132
133 void setMaxSymbolWidth( double );
134 double maxSymbolWidth() const;
135
136 virtual void drawSeries( QPainter*,
137 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
138 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
139
140 virtual QRectF boundingRect() const QWT_OVERRIDE;
141
142 virtual QwtGraphic legendIcon( int index, const QSizeF& ) const QWT_OVERRIDE;
143
144 protected:
145
146 void init();
147
148 virtual void drawSymbols( QPainter*,
149 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
150 const QRectF& canvasRect, int from, int to ) const;
151
152 virtual void drawUserSymbol( QPainter*,
154 Qt::Orientation, bool inverted, double symbolWidth ) const;
155
156 void drawBar( QPainter*, const QwtOHLCSample&,
157 Qt::Orientation, bool inverted, double width ) const;
158
159 void drawCandleStick( QPainter*, const QwtOHLCSample&,
160 Qt::Orientation, double width ) const;
161
162 virtual double scaledSymbolWidth(
163 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
164 const QRectF& canvasRect ) const;
165
166 private:
167 class PrivateData;
168 PrivateData* m_data;
169};
170
171Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotTradingCurve::PaintAttributes )
172
173#endif
A paint device for scalable graphics.
Definition qwt_graphic.h:76
Open-High-Low-Close sample used in financial charts.
virtual int rtti() const
Base class for plot items representing a series of samples.
QwtPlotTradingCurve illustrates movements in the price of a financial instrument over time.
QFlags< PaintAttribute > PaintAttributes
Direction
Direction of a price movement.
@ Increasing
The closing price is higher than the opening price.
A scale map.
Abstract interface for iterating over samples.
Class storing a QwtSeriesData object.
A class representing a text.
Definition qwt_text.h:52