KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
KDChartBarDiagram.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 KDCHARTBARDIAGRAM_H
12#define KDCHARTBARDIAGRAM_H
13
16
17QT_BEGIN_NAMESPACE
18class QPainter;
19QT_END_NAMESPACE
20
21namespace KDChart {
22
23class ThreeDBarAttributes;
24
30class KDCHART_EXPORT BarDiagram : public AbstractCartesianDiagram
31{
32 Q_OBJECT
33
34 Q_DISABLE_COPY(BarDiagram)
35
37
38public:
39 class BarDiagramType;
40 friend class BarDiagramType;
41
42 explicit BarDiagram(
43 QWidget *parent = nullptr, CartesianCoordinatePlane *plane = nullptr);
44 ~BarDiagram() override;
45
46 virtual BarDiagram *clone() const;
50 bool compare(const BarDiagram *other) const;
51
53 {
57 Rows Q_DECL_ENUMERATOR_DEPRECATED
58 };
59
60 void setType(const BarType type);
61 BarType type() const;
62
63 void setOrientation(Qt::Orientation orientation);
64 Qt::Orientation orientation() const;
65
66 void setBarAttributes(const BarAttributes &a);
67 void setBarAttributes(int column, const BarAttributes &a);
68 void setBarAttributes(const QModelIndex &index, const BarAttributes &a);
69
70 BarAttributes barAttributes() const;
71 BarAttributes barAttributes(int column) const;
72 BarAttributes barAttributes(const QModelIndex &index) const;
73
74 void setThreeDBarAttributes(const ThreeDBarAttributes &a);
75 void setThreeDBarAttributes(int column, const ThreeDBarAttributes &a);
76 void setThreeDBarAttributes(const QModelIndex &index,
77 const ThreeDBarAttributes &a);
78 ThreeDBarAttributes threeDBarAttributes() const;
79 ThreeDBarAttributes threeDBarAttributes(int column) const;
80 ThreeDBarAttributes threeDBarAttributes(const QModelIndex &index) const;
81
82#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined(Q_COMPILER_MANGLES_RETURN_TYPE)
83 // implement AbstractCartesianDiagram
85 const int numberOfAbscissaSegments() const;
87 const int numberOfOrdinateSegments() const;
88#else
89 // implement AbstractCartesianDiagram
91 int numberOfAbscissaSegments() const override;
93 int numberOfOrdinateSegments() const override;
94#endif
95
96protected:
97 void paint(PaintContext *paintContext) override;
98
99public:
100 void resize(const QSizeF &area) override;
101
102protected:
103 qreal threeDItemDepth(const QModelIndex &index) const override;
104 qreal threeDItemDepth(int column) const override;
106 const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
107 void paintEvent(QPaintEvent *) override;
108 void resizeEvent(QResizeEvent *) override;
109
110private:
111 void calculateValueAndGapWidths(int rowCount, int colCount,
112 qreal groupWidth,
113 qreal &barWidth,
114 qreal &spaceBetweenBars,
115 qreal &spaceBetweenGroups);
116}; // End of class BarDiagram
117}
118
119#endif // KDCHARTBARDIAGRAM_H
#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
Base class for diagrams based on a cartesian coordianate system.
Set of attributes for changing the appearance of bar charts.
BarDiagram defines a common bar diagram.
Stores information about painting diagrams.
Orientation

© 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 on Wed May 1 2024 00:01:10 for KD Chart API Documentation by doxygen 1.9.8