KD Chart 2  [rev.2.6]
KDChartStockDiagram.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2019 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();
51 
52  void setType( Type type );
53  Type type() const;
54 
55  void setStockBarAttributes( const StockBarAttributes &attr );
56  StockBarAttributes stockBarAttributes() const;
57 
58  void setStockBarAttributes( int column, const StockBarAttributes &attr );
59  StockBarAttributes stockBarAttributes( int column ) const;
60 
61  void setThreeDBarAttributes( const ThreeDBarAttributes &attr );
62  ThreeDBarAttributes threeDBarAttributes() const;
63 
64  void setThreeDBarAttributes( int column, const ThreeDBarAttributes &attr );
65  ThreeDBarAttributes threeDBarAttributes( int column ) const;
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 );
89  QPen downTrendCandlestickPen() const;
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  virtual int numberOfAbscissaSegments() const;
102  virtual int numberOfOrdinateSegments() const;
103 #endif
104 
105  virtual void paint( PaintContext *paintContext );
106 
107  virtual void resize( const QSizeF &size );
108 
109  virtual qreal threeDItemDepth( int column ) const;
110  virtual qreal threeDItemDepth( const QModelIndex &index ) const;
111 
112 protected:
113  virtual const QPair<QPointF, QPointF> calculateDataBoundaries() const;
114 };
115 
116 } // Namespace KDChart
117 
118 #endif // KDCHART_STOCK_DIAGRAM_H
119 
Base class for diagrams based on a cartesian coordianate system.
Stores information about painting diagrams.
A set of 3D bar attributes.
#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
Class only listed here to document inheritance of some KDChart classes.
Attributes to customize the appearance of a column in a stock chart.

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
https://www.kdab.com/
https://www.kdab.com/products/kd-chart/