KD Chart API Documentation
3.1
Loading...
Searching...
No Matches
source
src
KDChart
Cartesian
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
14
#include "
KDChartAbstractCartesianDiagram.h
"
15
#include "
KDChartBarAttributes.h
"
16
17
QT_BEGIN_NAMESPACE
18
class
QPainter
;
19
QT_END_NAMESPACE
20
21
namespace
KDChart
{
22
23
class
ThreeDBarAttributes;
24
30
class
KDCHART_EXPORT
BarDiagram
:
public
AbstractCartesianDiagram
31
{
32
Q_OBJECT
33
34
Q_DISABLE_COPY(
BarDiagram
)
35
36
KDCHART_DECLARE_DERIVED_DIAGRAM
(
BarDiagram
,
CartesianCoordinatePlane
)
37
38
public
:
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
52
enum
BarType
53
{
54
Normal
,
55
Stacked
,
56
Percent
,
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
96
protected
:
97
void
paint(
PaintContext
*paintContext)
override
;
98
99
public
:
100
void
resize(
const
QSizeF
&area)
override
;
101
102
protected
:
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
110
private
:
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
KDChartAbstractCartesianDiagram.h
KDChartBarAttributes.h
KDCHART_DECLARE_DERIVED_DIAGRAM
#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
Definition
KDChartGlobal.h:140
KDChart::AbstractCartesianDiagram
Base class for diagrams based on a cartesian coordianate system.
Definition
KDChartAbstractCartesianDiagram.h:30
KDChart::BarAttributes
Set of attributes for changing the appearance of bar charts.
Definition
KDChartBarAttributes.h:23
KDChart::BarDiagram
BarDiagram defines a common bar diagram.
Definition
KDChartBarDiagram.h:31
KDChart::BarDiagram::BarType
BarType
Definition
KDChartBarDiagram.h:53
KDChart::BarDiagram::Stacked
@ Stacked
Definition
KDChartBarDiagram.h:55
KDChart::BarDiagram::Percent
@ Percent
Definition
KDChartBarDiagram.h:56
KDChart::BarDiagram::Normal
@ Normal
Definition
KDChartBarDiagram.h:54
KDChart::CartesianCoordinatePlane
Cartesian coordinate plane.
Definition
KDChartCartesianCoordinatePlane.h:28
KDChart::PaintContext
Stores information about painting diagrams.
Definition
KDChartPaintContext.h:30
KDChart::ThreeDBarAttributes
A set of 3D bar attributes.
Definition
KDChartThreeDBarAttributes.h:24
KDChart
Definition
CartesianCoordinateTransformation.h:23
QModelIndex
QPainter
QPaintEvent
QPair
QResizeEvent
QSizeF
Qt::Orientation
Orientation
QWidget
© 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