1 | // Copyright (C) 2023 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | // W A R N I N G |
5 | // ------------- |
6 | // |
7 | // This file is not part of the QtGraphs API. It exists purely as an |
8 | // implementation detail. This header file may change from version to |
9 | // version without notice, or even be removed. |
10 | // |
11 | // We mean it. |
12 | |
13 | #ifndef QBARSERIES_P_H |
14 | #define QBARSERIES_P_H |
15 | |
16 | #include <QtGraphs/qbarseries.h> |
17 | #include <QtGraphs/qabstractseries.h> |
18 | #include <private/qabstractseries_p.h> |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class QBarSeriesPrivate : public QAbstractSeriesPrivate |
23 | { |
24 | public: |
25 | QBarSeriesPrivate(); |
26 | qsizetype categoryCount() const; |
27 | |
28 | void setBarWidth(qreal width); |
29 | qreal barWidth() const; |
30 | |
31 | void setVisible(bool visible); |
32 | void setLabelsVisible(bool visible); |
33 | |
34 | bool append(QBarSet *set); |
35 | bool remove(QBarSet *set); |
36 | bool append(const QList<QBarSet *> &sets); |
37 | bool remove(const QList<QBarSet *> &sets); |
38 | bool insert(qsizetype index, QBarSet *set); |
39 | |
40 | QBarSet *barsetAt(qsizetype index); |
41 | qreal min(); |
42 | qreal max(); |
43 | qreal valueAt(int set, int category); |
44 | qreal percentageAt(int set, int category); |
45 | qreal categorySum(qsizetype category); |
46 | qreal absoluteCategorySum(int category); |
47 | qreal maxCategorySum(); |
48 | qreal minX(); |
49 | qreal maxX(); |
50 | qreal categoryTop(qsizetype category); |
51 | qreal categoryBottom(qsizetype category); |
52 | qreal top(); |
53 | qreal bottom(); |
54 | |
55 | bool blockBarUpdate(); |
56 | |
57 | void setLabelsDirty(bool dirty) { m_labelsDirty = dirty; } |
58 | bool labelsDirty() const { return m_labelsDirty; } |
59 | |
60 | protected: |
61 | QList<QBarSet *> m_barSets; |
62 | QList<QColor> m_seriesColors; |
63 | QList<QColor> m_borderColors; |
64 | qreal m_barWidth; |
65 | bool m_labelsVisible; |
66 | bool m_visible; |
67 | bool m_blockBarUpdate; |
68 | QString m_labelsFormat; |
69 | QBarSeries::BarsType m_barsType = QBarSeries::BarsType::Groups; |
70 | QBarSeries::LabelsPosition m_labelsPosition = QBarSeries::LabelsPosition::Center; |
71 | qreal m_labelsMargin; |
72 | qreal m_labelsAngle; |
73 | int m_labelsPrecision; |
74 | bool m_labelsDirty; |
75 | bool m_barDelegateDirty; |
76 | QQmlComponent *m_barDelegate = nullptr; |
77 | |
78 | private: |
79 | Q_DECLARE_PUBLIC(QBarSeries) |
80 | }; |
81 | |
82 | QT_END_NAMESPACE |
83 | |
84 | #endif // QBARSERIES_P_H |
85 | |