KDChartLineDiagram.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KDCHARTLINEDIAGRAM_H
00024 #define KDCHARTLINEDIAGRAM_H
00025
00026 #include "KDChartAbstractCartesianDiagram.h"
00027 #include "KDChartLineAttributes.h"
00028 #include "KDChartValueTrackerAttributes.h"
00029
00030 class QPainter;
00031 class QPolygonF;
00032
00033 namespace KDChart {
00034
00035 class ThreeDLineAttributes;
00036
00042 class KDCHART_EXPORT LineDiagram : public AbstractCartesianDiagram
00043 {
00044 Q_OBJECT
00045
00046 Q_DISABLE_COPY( LineDiagram )
00047
00048
00049 KDCHART_DECLARE_DERIVED_DIAGRAM( LineDiagram, CartesianCoordinatePlane )
00050
00051
00052 public:
00053 class LineDiagramType;
00054 friend class LineDiagramType;
00055
00056 explicit LineDiagram( QWidget* parent = 0, CartesianCoordinatePlane* plane = 0 );
00057 virtual ~LineDiagram();
00058
00059 virtual LineDiagram * clone() const;
00060
00064 bool compare( const LineDiagram* other ) const;
00065
00066 enum LineType {
00067 Normal = 0,
00068 Stacked = 1,
00069 Percent = 2
00070 };
00071
00072
00073 void setType( const LineType type );
00074 LineType type() const;
00075
00082 void setCenterDataPoints( bool center );
00084 bool centerDataPoints() const;
00085
00091 void setReverseDatasetOrder( bool reverse );
00093 bool reverseDatasetOrder() const;
00094
00095 void setLineAttributes( const LineAttributes & a );
00096 void setLineAttributes( int column, const LineAttributes & a );
00097 void setLineAttributes( const QModelIndex & index, const LineAttributes & a );
00098 void resetLineAttributes( int column );
00099 void resetLineAttributes( const QModelIndex & index );
00100 LineAttributes lineAttributes() const;
00101 LineAttributes lineAttributes( int column ) const;
00102 LineAttributes lineAttributes( const QModelIndex & index ) const;
00103
00104 void setThreeDLineAttributes( const ThreeDLineAttributes & a );
00105 void setThreeDLineAttributes( int column, const ThreeDLineAttributes & a );
00106 void setThreeDLineAttributes( const QModelIndex & index,
00107 const ThreeDLineAttributes & a );
00108
00109
00110
00111
00112 ThreeDLineAttributes threeDLineAttributes() const;
00113 ThreeDLineAttributes threeDLineAttributes( int column ) const;
00114 ThreeDLineAttributes threeDLineAttributes( const QModelIndex & index ) const;
00115
00116 void setValueTrackerAttributes( const QModelIndex & index,
00117 const ValueTrackerAttributes & a );
00118 ValueTrackerAttributes valueTrackerAttributes( const QModelIndex & index ) const;
00119
00120 #if QT_VERSION < 0x040400 || defined(Q_COMPILER_MANGLES_RETURN_TYPE)
00121
00122
00123 const int numberOfAbscissaSegments () const;
00124
00125 const int numberOfOrdinateSegments () const;
00126 #else
00127
00128
00129 int numberOfAbscissaSegments () const;
00130
00131 int numberOfOrdinateSegments () const;
00132 #endif
00133
00134 protected:
00135 void paint ( PaintContext* paintContext );
00136
00137 public:
00138 void resize ( const QSizeF& area );
00139
00140 protected:
00141
00142 double valueForCellTesting( int row, int column,
00143 bool& bOK,
00144 bool showHiddenCellsAsInvalid = false ) const;
00145 LineAttributes::MissingValuesPolicy getCellValues(
00146 int row, int column,
00147 bool shiftCountedXValuesByHalfSection,
00148 double& valueX, double& valueY ) const;
00149
00150 virtual double threeDItemDepth( const QModelIndex & index ) const;
00151 virtual double threeDItemDepth( int column ) const;
00153 virtual const QPair<QPointF, QPointF> calculateDataBoundaries() const;
00154 void paintEvent ( QPaintEvent* );
00155 void resizeEvent ( QResizeEvent* );
00156 };
00157
00158 }
00159
00160 #endif // KDCHARTLINEDIAGRAM_H