KD Chart 2  [rev.2.7]
KDChartStockDiagram.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2020 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHART_STOCK_DIAGRAM_H
24 #define KDCHART_STOCK_DIAGRAM_H
25 
30 
31 namespace KDChart {
32  class PaintContext;
33 
34 class KDCHART_EXPORT StockDiagram : public AbstractCartesianDiagram
35 {
36  Q_OBJECT
37 
38  Q_DISABLE_COPY( StockDiagram )
39 
41 
42 public:
43  enum Type {
46  Candlestick
47  };
48 
49  explicit StockDiagram( QWidget *parent = 0, CartesianCoordinatePlane *plane = 0 );
50  ~StockDiagram() override;
51 
52  void setType( Type type );
53  Type type() const;
54 
57 
58  void setStockBarAttributes( int column, const StockBarAttributes &attr );
60 
63 
64  void setThreeDBarAttributes( int column, const ThreeDBarAttributes &attr );
66 
67  void setLowHighLinePen( const QPen &pen );
68  QPen lowHighLinePen() const;
69 
70  void setLowHighLinePen( int column, const QPen &pen );
71  QPen lowHighLinePen( int column ) const;
72 
73  void setUpTrendCandlestickBrush( const QBrush &brush );
74  QBrush upTrendCandlestickBrush() const;
75 
76  void setDownTrendCandlestickBrush( const QBrush &brush );
77  QBrush downTrendCandlestickBrush() const;
78 
79  void setUpTrendCandlestickBrush( int column, const QBrush &brush );
80  QBrush upTrendCandlestickBrush( int column ) const;
81 
82  void setDownTrendCandlestickBrush( int column, const QBrush &brush );
83  QBrush downTrendCandlestickBrush( int column ) const;
84 
85  void setUpTrendCandlestickPen( const QPen &pen );
86  QPen upTrendCandlestickPen() const;
87 
88  void setDownTrendCandlestickPen( const QPen &pen );
90 
91  void setUpTrendCandlestickPen( int column, const QPen &pen );
92  QPen upTrendCandlestickPen( int column ) const;
93 
94  void setDownTrendCandlestickPen( int column, const QPen &pen );
95  QPen downTrendCandlestickPen( int column ) const;
96 
97 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
98  virtual const int numberOfAbscissaSegments() const;
99  virtual const int numberOfOrdinateSegments() const;
100 #else
101  int numberOfAbscissaSegments() const override;
102  int numberOfOrdinateSegments() const override;
103 #endif
104 
105  void paint( PaintContext *paintContext ) override;
106 
107  void resize( const QSizeF &size ) override;
108 
109  qreal threeDItemDepth( int column ) const override;
110  qreal threeDItemDepth( const QModelIndex &index ) const override;
111 
112 protected:
114 };
115 
116 } // Namespace KDChart
117 
118 #endif // KDCHART_STOCK_DIAGRAM_H
119 
KDChart::StockDiagram::Type
Type
Definition: KDChartStockDiagram.h:43
StockDiagram
KDChart::StockDiagram::setThreeDBarAttributes
void setThreeDBarAttributes(int column, const ThreeDBarAttributes &attr)
QWidget
Class only listed here to document inheritance of some KDChart classes.
KDChart::StockDiagram::setDownTrendCandlestickBrush
void setDownTrendCandlestickBrush(const QBrush &brush)
KDChart::StockDiagram::lowHighLinePen
QPen lowHighLinePen(int column) const
KDChart::StockDiagram::HighLowClose
@ HighLowClose
Definition: KDChartStockDiagram.h:44
KDChart::StockDiagram::threeDBarAttributes
ThreeDBarAttributes threeDBarAttributes(int column) const
KDChart::StockDiagram::downTrendCandlestickPen
QPen downTrendCandlestickPen() const
KDChart::StockDiagram::setLowHighLinePen
void setLowHighLinePen(const QPen &pen)
KDChart
Definition: KDChartAbstractCartesianDiagram.h:30
KDChart::StockBarAttributes
Attributes to customize the appearance of a column in a stock chart.
Definition: KDChartStockBarAttributes.h:35
KDChartCartesianCoordinatePlane.h
KDChart::StockDiagram::setDownTrendCandlestickPen
void setDownTrendCandlestickPen(int column, const QPen &pen)
KDChart::StockDiagram::setUpTrendCandlestickBrush
void setUpTrendCandlestickBrush(const QBrush &brush)
KDChart::StockDiagram::setStockBarAttributes
void setStockBarAttributes(int column, const StockBarAttributes &attr)
KDChart::StockDiagram::upTrendCandlestickBrush
QBrush upTrendCandlestickBrush(int column) const
KDChartStockBarAttributes.h
KDChart::StockDiagram::setUpTrendCandlestickPen
void setUpTrendCandlestickPen(const QPen &pen)
KDChart::StockDiagram::type
Type type() const
KDChart::StockDiagram::setDownTrendCandlestickBrush
void setDownTrendCandlestickBrush(int column, const QBrush &brush)
KDChart::StockDiagram::setLowHighLinePen
void setLowHighLinePen(int column, const QPen &pen)
KDChart::PaintContext
Stores information about painting diagrams.
Definition: KDChartPaintContext.h:42
KDChart::StockDiagram::setThreeDBarAttributes
void setThreeDBarAttributes(const ThreeDBarAttributes &attr)
KDChart::StockDiagram::numberOfAbscissaSegments
virtual const int numberOfAbscissaSegments() const
KDChart::StockDiagram::downTrendCandlestickBrush
QBrush downTrendCandlestickBrush(int column) const
KDChart::StockDiagram::paint
void paint(PaintContext *paintContext) override
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint conte...
KDCHART_DECLARE_DERIVED_DIAGRAM
#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
Definition: KDChartGlobal.h:113
KDChart::StockDiagram::threeDItemDepth
qreal threeDItemDepth(int column) const override
KDChart::StockDiagram::lowHighLinePen
QPen lowHighLinePen() const
KDChart::AbstractCartesianDiagram
Base class for diagrams based on a cartesian coordianate system.
Definition: KDChartAbstractCartesianDiagram.h:42
KDChart::StockDiagram::resize
void resize(const QSizeF &size) override
Called by the widget's sizeEvent.
KDChart::StockDiagram::downTrendCandlestickPen
QPen downTrendCandlestickPen(int column) const
KDChart::StockDiagram::numberOfOrdinateSegments
virtual const int numberOfOrdinateSegments() const
KDChartAbstractCartesianDiagram.h
KDChart::StockDiagram::threeDBarAttributes
ThreeDBarAttributes threeDBarAttributes() const
KDChart::StockDiagram::calculateDataBoundaries
const QPair< QPointF, QPointF > calculateDataBoundaries() const override
KDChart::StockDiagram::upTrendCandlestickPen
QPen upTrendCandlestickPen() const
KDChart::StockDiagram::threeDItemDepth
qreal threeDItemDepth(const QModelIndex &index) const override
KDChart::StockDiagram::upTrendCandlestickPen
QPen upTrendCandlestickPen(int column) const
KDChart::StockDiagram::StockDiagram
StockDiagram(QWidget *parent=0, CartesianCoordinatePlane *plane=0)
KDChart::ThreeDBarAttributes
A set of 3D bar attributes.
Definition: KDChartThreeDBarAttributes.h:36
KDChart::StockDiagram::setUpTrendCandlestickPen
void setUpTrendCandlestickPen(int column, const QPen &pen)
KDChart::StockDiagram::downTrendCandlestickBrush
QBrush downTrendCandlestickBrush() const
QPair
Definition: KDChartWidget.h:35
KDChart::StockDiagram::upTrendCandlestickBrush
QBrush upTrendCandlestickBrush() const
KDChart::StockDiagram::OpenHighLowClose
@ OpenHighLowClose
Definition: KDChartStockDiagram.h:45
KDChart::CartesianCoordinatePlane
Cartesian coordinate plane.
Definition: KDChartCartesianCoordinatePlane.h:40
KDChart::StockDiagram::~StockDiagram
~StockDiagram() override
KDChart::StockDiagram::stockBarAttributes
StockBarAttributes stockBarAttributes(int column) const
KDChart::StockDiagram::setUpTrendCandlestickBrush
void setUpTrendCandlestickBrush(int column, const QBrush &brush)
KDChart::StockDiagram::setDownTrendCandlestickPen
void setDownTrendCandlestickPen(const QPen &pen)
KDChartThreeDBarAttributes.h
KDChart::StockDiagram::setStockBarAttributes
void setStockBarAttributes(const StockBarAttributes &attr)
KDChart::StockDiagram::setType
void setType(Type type)
KDChart::StockDiagram::stockBarAttributes
StockBarAttributes stockBarAttributes() const

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-chart/