KD Chart 2  [rev.2.6]
KDChartLineDiagram.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** Copyright (C) 2001-2019 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Chart library.
5 **
6 ** Licensees holding valid commercial KD Chart licenses may use this file in
7 ** accordance with the KD Chart Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 
23 #ifndef KDCHARTLINEDIAGRAM_H
24 #define KDCHARTLINEDIAGRAM_H
25 
27 #include "KDChartLineAttributes.h"
29 
30 QT_BEGIN_NAMESPACE
31 class QPainter;
32 class QPolygonF;
33 QT_END_NAMESPACE
34 
35 namespace KDChart {
36 
37  class ThreeDLineAttributes;
38 
44 class KDCHART_EXPORT LineDiagram : public AbstractCartesianDiagram
45 {
46  Q_OBJECT
47 
48  Q_DISABLE_COPY( LineDiagram )
49 // KDCHART_DECLARE_PRIVATE_DERIVED_PARENT( LineDiagram, CartesianCoordinatePlane * )
50 
52 
53 
54 public:
55  class LineDiagramType;
56  friend class LineDiagramType;
57 
58  explicit LineDiagram( QWidget* parent = 0, CartesianCoordinatePlane* plane = 0 );
59  virtual ~LineDiagram();
60 
61  virtual LineDiagram * clone() const;
62 
66  bool compare( const LineDiagram* other ) const;
67 
68  enum LineType {
69  Normal = 0,
70  Stacked = 1,
71  Percent = 2
72  };
73 
74 
75  void setType( const LineType type );
76  LineType type() const;
77 
84  void setCenterDataPoints( bool center );
86  bool centerDataPoints() const;
87 
93  void setReverseDatasetOrder( bool reverse );
95  bool reverseDatasetOrder() const;
96 
97  void setLineAttributes( const LineAttributes & a );
98  void setLineAttributes( int column, const LineAttributes & a );
99  void setLineAttributes( const QModelIndex & index, const LineAttributes & a );
100  void resetLineAttributes( int column );
101  void resetLineAttributes( const QModelIndex & index );
102  LineAttributes lineAttributes() const;
103  LineAttributes lineAttributes( int column ) const;
104  LineAttributes lineAttributes( const QModelIndex & index ) const;
105 
106  void setThreeDLineAttributes( const ThreeDLineAttributes & a );
107  void setThreeDLineAttributes( int column, const ThreeDLineAttributes & a );
108  void setThreeDLineAttributes( const QModelIndex & index,
109  const ThreeDLineAttributes & a );
110 
112  ThreeDLineAttributes threeDLineAttributes( int column ) const;
113  ThreeDLineAttributes threeDLineAttributes( const QModelIndex & index ) const;
114 
115  void setValueTrackerAttributes( const QModelIndex & index,
116  const ValueTrackerAttributes & a );
117  ValueTrackerAttributes valueTrackerAttributes( const QModelIndex & index ) const;
118 
119 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
120  // implement AbstractCartesianDiagram
121  /* reimpl */
122  const int numberOfAbscissaSegments () const;
123  /* reimpl */
124  const int numberOfOrdinateSegments () const;
125 #else
126  // implement AbstractCartesianDiagram
127  /* reimpl */
128  int numberOfAbscissaSegments () const;
129  /* reimpl */
130  int numberOfOrdinateSegments () const;
131 #endif
132 
133 protected:
134  void paint ( PaintContext* paintContext );
135 
136 public:
137  void resize ( const QSizeF& area );
138 
139 protected:
140 
141  virtual qreal threeDItemDepth( const QModelIndex & index ) const;
142  virtual qreal threeDItemDepth( int column ) const;
144  virtual const QPair<QPointF, QPointF> calculateDataBoundaries() const;
145  void paintEvent ( QPaintEvent* );
146  void resizeEvent ( QResizeEvent* );
147 }; // End of class KDChartLineDiagram
148 
149 }
150 
151 #endif // KDCHARTLINEDIAGRAM_H
static ValueTrackerAttributes valueTrackerAttributes(AbstractDiagram *diagram, const QModelIndex &index)
Set of attributes for changing the appearance of line charts.
LineDiagram defines a common line diagram.
Cell-specific attributes regarding value tracking.
Base class for diagrams based on a cartesian coordianate system.
Stores information about painting diagrams.
#define KDCHART_DECLARE_DERIVED_DIAGRAM(X, PLANE)
Class only listed here to document inheritance of some KDChart classes.
static ThreeDLineAttributes threeDLineAttributes(AbstractDiagram *diagram, const QModelIndex &index)
A set of 3D line attributes.

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
https://www.kdab.com/
https://www.kdab.com/products/kd-chart/