KD Chart API Documentation  3.1
KDChartStockDiagram.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Chart library.
4 **
5 ** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDCHART_STOCK_DIAGRAM_H
12 #define KDCHART_STOCK_DIAGRAM_H
13 
18 
19 namespace KDChart {
20 class PaintContext;
21 
22 class KDCHART_EXPORT StockDiagram : public AbstractCartesianDiagram
23 {
24  Q_OBJECT
25 
26  Q_DISABLE_COPY(StockDiagram)
27 
29 
30 public:
31  enum Type
32  {
35  Candlestick
36  };
37 
38  explicit StockDiagram(QWidget *parent = nullptr, CartesianCoordinatePlane *plane = nullptr);
39  ~StockDiagram() override;
40 
41  void setType(Type type);
42  Type type() const;
43 
44  void setStockBarAttributes(const StockBarAttributes &attr);
45  StockBarAttributes stockBarAttributes() const;
46 
47  void setStockBarAttributes(int column, const StockBarAttributes &attr);
48  StockBarAttributes stockBarAttributes(int column) const;
49 
50  void setThreeDBarAttributes(const ThreeDBarAttributes &attr);
51  ThreeDBarAttributes threeDBarAttributes() const;
52 
53  void setThreeDBarAttributes(int column, const ThreeDBarAttributes &attr);
54  ThreeDBarAttributes threeDBarAttributes(int column) const;
55 
56  void setLowHighLinePen(const QPen &pen);
57  QPen lowHighLinePen() const;
58 
59  void setLowHighLinePen(int column, const QPen &pen);
60  QPen lowHighLinePen(int column) const;
61 
62  void setUpTrendCandlestickBrush(const QBrush &brush);
63  QBrush upTrendCandlestickBrush() const;
64 
65  void setDownTrendCandlestickBrush(const QBrush &brush);
66  QBrush downTrendCandlestickBrush() const;
67 
68  void setUpTrendCandlestickBrush(int column, const QBrush &brush);
69  QBrush upTrendCandlestickBrush(int column) const;
70 
71  void setDownTrendCandlestickBrush(int column, const QBrush &brush);
72  QBrush downTrendCandlestickBrush(int column) const;
73 
74  void setUpTrendCandlestickPen(const QPen &pen);
75  QPen upTrendCandlestickPen() const;
76 
77  void setDownTrendCandlestickPen(const QPen &pen);
78  QPen downTrendCandlestickPen() const;
79 
80  void setUpTrendCandlestickPen(int column, const QPen &pen);
81  QPen upTrendCandlestickPen(int column) const;
82 
83  void setDownTrendCandlestickPen(int column, const QPen &pen);
84  QPen downTrendCandlestickPen(int column) const;
85 
86 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined(Q_COMPILER_MANGLES_RETURN_TYPE)
87  virtual const int numberOfAbscissaSegments() const;
88  virtual const int numberOfOrdinateSegments() const;
89 #else
90  int numberOfAbscissaSegments() const override;
91  int numberOfOrdinateSegments() const override;
92 #endif
93 
94  void paint(PaintContext *paintContext) override;
95 
96  void resize(const QSizeF &size) override;
97 
98  qreal threeDItemDepth(int column) const override;
99  qreal threeDItemDepth(const QModelIndex &index) const override;
100 
101 protected:
102  const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
103 };
104 
105 } // Namespace KDChart
106 
107 #endif // KDCHART_STOCK_DIAGRAM_H
#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
Base class for diagrams based on a cartesian coordianate system.
Stores information about painting diagrams.
Attributes to customize the appearance of a column in a stock chart.

© 2001 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/
Generated by doxygen 1.9.1