1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QCANDLESTICKSERIES_H
5#define QCANDLESTICKSERIES_H
6
7#include <QtCharts/QAbstractSeries>
8
9QT_BEGIN_NAMESPACE
10
11class QCandlestickSeriesPrivate;
12class QCandlestickSet;
13
14class Q_CHARTS_EXPORT QCandlestickSeries : public QAbstractSeries
15{
16 Q_OBJECT
17 Q_PROPERTY(int count READ count NOTIFY countChanged)
18 Q_PROPERTY(qreal maximumColumnWidth READ maximumColumnWidth WRITE setMaximumColumnWidth NOTIFY maximumColumnWidthChanged)
19 Q_PROPERTY(qreal minimumColumnWidth READ minimumColumnWidth WRITE setMinimumColumnWidth NOTIFY minimumColumnWidthChanged)
20 Q_PROPERTY(qreal bodyWidth READ bodyWidth WRITE setBodyWidth NOTIFY bodyWidthChanged)
21 Q_PROPERTY(bool bodyOutlineVisible READ bodyOutlineVisible WRITE setBodyOutlineVisible NOTIFY bodyOutlineVisibilityChanged)
22 Q_PROPERTY(qreal capsWidth READ capsWidth WRITE setCapsWidth NOTIFY capsWidthChanged)
23 Q_PROPERTY(bool capsVisible READ capsVisible WRITE setCapsVisible NOTIFY capsVisibilityChanged)
24 Q_PROPERTY(QColor increasingColor READ increasingColor WRITE setIncreasingColor NOTIFY increasingColorChanged)
25 Q_PROPERTY(QColor decreasingColor READ decreasingColor WRITE setDecreasingColor NOTIFY decreasingColorChanged)
26 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
27 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
28
29public:
30 explicit QCandlestickSeries(QObject *parent = nullptr);
31 ~QCandlestickSeries();
32
33 bool append(QCandlestickSet *set);
34 bool remove(QCandlestickSet *set);
35 bool append(const QList<QCandlestickSet *> &sets);
36 bool remove(const QList<QCandlestickSet *> &sets);
37 bool insert(int index, QCandlestickSet *set);
38 bool take(QCandlestickSet *set);
39 void clear();
40
41 QList<QCandlestickSet *> sets() const;
42 int count() const;
43
44 QAbstractSeries::SeriesType type() const override;
45
46 void setMaximumColumnWidth(qreal maximumColumnWidth);
47 qreal maximumColumnWidth() const;
48
49 void setMinimumColumnWidth(qreal minimumColumnWidth);
50 qreal minimumColumnWidth() const;
51
52 void setBodyWidth(qreal bodyWidth);
53 qreal bodyWidth() const;
54
55 void setBodyOutlineVisible(bool bodyOutlineVisible);
56 bool bodyOutlineVisible() const;
57
58 void setCapsWidth(qreal capsWidth);
59 qreal capsWidth() const;
60
61 void setCapsVisible(bool capsVisible);
62 bool capsVisible() const;
63
64 void setIncreasingColor(const QColor &increasingColor);
65 QColor increasingColor() const;
66
67 void setDecreasingColor(const QColor &decreasingColor);
68 QColor decreasingColor() const;
69
70 void setBrush(const QBrush &brush);
71 QBrush brush() const;
72
73 void setPen(const QPen &pen);
74 QPen pen() const;
75
76Q_SIGNALS:
77 void clicked(QCandlestickSet *set);
78 void hovered(bool status, QCandlestickSet *set);
79 void pressed(QCandlestickSet *set);
80 void released(QCandlestickSet *set);
81 void doubleClicked(QCandlestickSet *set);
82 void candlestickSetsAdded(const QList<QCandlestickSet *> &sets);
83 void candlestickSetsRemoved(const QList<QCandlestickSet *> &sets);
84 void countChanged();
85 void maximumColumnWidthChanged();
86 void minimumColumnWidthChanged();
87 void bodyWidthChanged();
88 void bodyOutlineVisibilityChanged();
89 void capsWidthChanged();
90 void capsVisibilityChanged();
91 void increasingColorChanged();
92 void decreasingColorChanged();
93 void brushChanged();
94 void penChanged();
95
96private:
97 Q_DISABLE_COPY(QCandlestickSeries)
98 Q_DECLARE_PRIVATE(QCandlestickSeries)
99 friend class CandlestickChartItem;
100 friend class QCandlestickLegendMarkerPrivate;
101};
102
103QT_END_NAMESPACE
104
105#endif // QCANDLESTICKSERIES_H
106

source code of qtcharts/src/charts/candlestickchart/qcandlestickseries.h