KD Chart API Documentation  3.1
KDChartLineDiagram.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 KDCHARTLINEDIAGRAM_H
12 #define KDCHARTLINEDIAGRAM_H
13 
15 #include "KDChartLineAttributes.h"
17 
18 QT_BEGIN_NAMESPACE
19 class QPainter;
20 class QPolygonF;
21 QT_END_NAMESPACE
22 
23 namespace KDChart {
24 
25 class ThreeDLineAttributes;
26 
32 class KDCHART_EXPORT LineDiagram : public AbstractCartesianDiagram
33 {
34  Q_OBJECT
35 
36  Q_DISABLE_COPY(LineDiagram)
37  // KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( LineDiagram, CartesianCoordinatePlane * )
38 
40 
41 public:
42  class LineDiagramType;
43  friend class LineDiagramType;
44 
45  explicit LineDiagram(QWidget *parent = nullptr, CartesianCoordinatePlane *plane = nullptr);
46  ~LineDiagram() override;
47 
48  virtual LineDiagram *clone() const;
49 
53  bool compare(const LineDiagram *other) const;
54 
55  enum LineType
56  {
57  Normal = 0,
58  Stacked = 1,
59  Percent = 2
60  };
61 
62  void setType(const LineType type);
63  LineType type() const;
64 
71  void setCenterDataPoints(bool center);
73  bool centerDataPoints() const;
74 
80  void setReverseDatasetOrder(bool reverse);
82  bool reverseDatasetOrder() const;
83 
84  void setLineAttributes(const LineAttributes &a);
85  void setLineAttributes(int column, const LineAttributes &a);
86  void setLineAttributes(const QModelIndex &index, const LineAttributes &a);
87  void resetLineAttributes(int column);
88  void resetLineAttributes(const QModelIndex &index);
89  LineAttributes lineAttributes() const;
90  LineAttributes lineAttributes(int column) const;
91  LineAttributes lineAttributes(const QModelIndex &index) const;
92 
93  void setThreeDLineAttributes(const ThreeDLineAttributes &a);
94  void setThreeDLineAttributes(int column, const ThreeDLineAttributes &a);
95  void setThreeDLineAttributes(const QModelIndex &index,
96  const ThreeDLineAttributes &a);
97 
98  ThreeDLineAttributes threeDLineAttributes() const;
99  ThreeDLineAttributes threeDLineAttributes(int column) const;
100  ThreeDLineAttributes threeDLineAttributes(const QModelIndex &index) const;
101 
102  void setValueTrackerAttributes(const QModelIndex &index,
103  const ValueTrackerAttributes &a);
104  ValueTrackerAttributes valueTrackerAttributes(const QModelIndex &index) const;
105 
111  void setLineTension(qreal tenson);
112  qreal lineTension() const;
113 
114 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined(Q_COMPILER_MANGLES_RETURN_TYPE)
115  // implement AbstractCartesianDiagram
116  /* reimp */
117  const int numberOfAbscissaSegments() const;
118  /* reimp */
119  const int numberOfOrdinateSegments() const;
120 #else
121  // implement AbstractCartesianDiagram
122  /* reimp */
123  int numberOfAbscissaSegments() const override;
124  /* reimp */
125  int numberOfOrdinateSegments() const override;
126 #endif
127 
128 protected:
129  void paint(PaintContext *paintContext) override;
130 
131 public:
132  void resize(const QSizeF &area) override;
133 
134 protected:
135  qreal threeDItemDepth(const QModelIndex &index) const override;
136  qreal threeDItemDepth(int column) const override;
138  const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
139  void paintEvent(QPaintEvent *) override;
140  void resizeEvent(QResizeEvent *) override;
141 }; // End of class KDChartLineDiagram
142 }
143 
144 #endif // KDCHARTLINEDIAGRAM_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 line charts.
LineDiagram defines a common line diagram.
Stores information about painting diagrams.
Cell-specific attributes regarding value tracking.

© 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