KChart

KChartLineDiagram.h
1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef KCHARTLINEDIAGRAM_H
21 #define KCHARTLINEDIAGRAM_H
22 
23 #include "KChartAbstractCartesianDiagram.h"
24 #include "KChartLineAttributes.h"
25 #include "KChartValueTrackerAttributes.h"
26 
27 QT_BEGIN_NAMESPACE
28 class QPainter;
29 class QPolygonF;
30 QT_END_NAMESPACE
31 
32 namespace KChart {
33 
34  class ThreeDLineAttributes;
35 
41 class KCHART_EXPORT LineDiagram : public AbstractCartesianDiagram
42 {
43  Q_OBJECT
44 
45  Q_DISABLE_COPY( LineDiagram )
46 // KCHART_DECLARE_PRIVATE_DERIVED_PARENT( LineDiagram, CartesianCoordinatePlane * )
47 
48  KCHART_DECLARE_DERIVED_DIAGRAM( LineDiagram, CartesianCoordinatePlane )
49 
50 
51 public:
52  class LineDiagramType;
53  friend class LineDiagramType;
54 
55  explicit LineDiagram( QWidget* parent = nullptr, CartesianCoordinatePlane* plane = nullptr );
56  virtual ~LineDiagram();
57 
58 
62  virtual LineDiagram * clone() const;
63 
67  bool compare( const LineDiagram* other ) const;
68 
69  enum LineType {
70  Normal = 0,
71  Stacked = 1,
72  Percent = 2
73  };
74 
75 
76 
81  void setType( const LineType type );
82 
86  LineType type() const;
87 
94  void setCenterDataPoints( bool center );
96  bool centerDataPoints() const;
97 
103  void setReverseDatasetOrder( bool reverse );
105  bool reverseDatasetOrder() const;
106 
107 
111  void setLineAttributes( const LineAttributes & a );
112 
116  void setLineAttributes( int column, const LineAttributes & a );
117 
121  void setLineAttributes( const QModelIndex & index, const LineAttributes & a );
122 
126  void resetLineAttributes( int column );
127 
131  void resetLineAttributes( const QModelIndex & index );
132 
136  LineAttributes lineAttributes() const;
137 
141  LineAttributes lineAttributes( int column ) const;
142 
146  LineAttributes lineAttributes( const QModelIndex & index ) const;
147 
148 
152  void setThreeDLineAttributes( const ThreeDLineAttributes & a );
153 
157  void setThreeDLineAttributes( int column, const ThreeDLineAttributes &ta );
158 
162  void setThreeDLineAttributes( const QModelIndex & index,
163  const ThreeDLineAttributes &la );
164 
165 
169  ThreeDLineAttributes threeDLineAttributes() const;
170 
174  ThreeDLineAttributes threeDLineAttributes( int column ) const;
175 
179  ThreeDLineAttributes threeDLineAttributes( const QModelIndex & index ) const;
180 
181 
185  void setValueTrackerAttributes( const QModelIndex & index,
186  const ValueTrackerAttributes & a );
187 
191  ValueTrackerAttributes valueTrackerAttributes( const QModelIndex & index ) const;
192 
193 #if defined(Q_COMPILER_MANGLES_RETURN_TYPE)
194  // implement AbstractCartesianDiagram
195  /* reimpl */
196  const int numberOfAbscissaSegments () const;
197  /* reimpl */
198  const int numberOfOrdinateSegments () const;
199 #else
200  // implement AbstractCartesianDiagram
201  /* reimpl */
202  int numberOfAbscissaSegments () const override;
203  /* reimpl */
204  int numberOfOrdinateSegments () const override;
205 #endif
206 
207 protected:
208  void paint ( PaintContext* paintContext ) override;
209 
210 public:
211  void resize ( const QSizeF& area ) override;
212 
213 protected:
214 
215  qreal threeDItemDepth( const QModelIndex & index ) const override;
216  qreal threeDItemDepth( int column ) const override;
218  const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
219  void paintEvent ( QPaintEvent* ) override;
220  void resizeEvent ( QResizeEvent* ) override;
221 }; // End of class KChartLineDiagram
222 
223 }
224 
225 #endif // KCHARTLINEDIAGRAM_H
Class only listed here to document inheritance of some KChart classes.
A set of 3D line attributes.
Set of attributes for changing the appearance of line charts.
Stores information about painting diagrams.
Base class for diagrams based on a cartesian coordianate system.
Cell-specific attributes regarding value tracking.
LineDiagram defines a common line diagram.
Global namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:36:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.