00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef KDCHARTLINEDIAGRAM_H
00031 #define KDCHARTLINEDIAGRAM_H
00032
00033 #include "KDChartAbstractCartesianDiagram.h"
00034 #include "KDChartLineAttributes.h"
00035 #include "KDChartValueTrackerAttributes.h"
00036
00037 class QPainter;
00038 class QPolygonF;
00039
00040 namespace KDChart {
00041
00042 class ThreeDLineAttributes;
00043
00049 class KDCHART_EXPORT LineDiagram : public AbstractCartesianDiagram
00050 {
00051 Q_OBJECT
00052
00053 Q_DISABLE_COPY( LineDiagram )
00054
00055
00056 KDCHART_DECLARE_DERIVED_DIAGRAM( LineDiagram, CartesianCoordinatePlane )
00057
00058
00059 public:
00060 class LineDiagramType;
00061 friend class LineDiagramType;
00062
00063 LineDiagram( QWidget* parent = 0, CartesianCoordinatePlane* plane = 0 );
00064 virtual ~LineDiagram();
00065
00066 virtual LineDiagram * clone() const;
00067
00071 bool compare( const LineDiagram* other ) const;
00072
00073 enum LineType {
00074 Normal = 0,
00075 Stacked = 1,
00076 Percent = 2
00077 };
00078
00079
00080 void setType( const LineType type );
00081 LineType type() const;
00082
00083 void setLineAttributes( const LineAttributes & a );
00084 void setLineAttributes( int column, const LineAttributes & a );
00085 void setLineAttributes( const QModelIndex & index, const LineAttributes & a );
00086 void resetLineAttributes( int column );
00087 void resetLineAttributes( const QModelIndex & index );
00088 LineAttributes lineAttributes() const;
00089 LineAttributes lineAttributes( int column ) const;
00090 LineAttributes lineAttributes( const QModelIndex & index ) const;
00091
00092 void setThreeDLineAttributes( const ThreeDLineAttributes & a );
00093 void setThreeDLineAttributes( int column, const ThreeDLineAttributes & a );
00094 void setThreeDLineAttributes( const QModelIndex & index,
00095 const ThreeDLineAttributes & a );
00096
00097
00098
00099
00100 ThreeDLineAttributes threeDLineAttributes() const;
00101 ThreeDLineAttributes threeDLineAttributes( int column ) const;
00102 ThreeDLineAttributes threeDLineAttributes( const QModelIndex & index ) const;
00103
00104 void setValueTrackerAttributes( const QModelIndex & index,
00105 const ValueTrackerAttributes & a );
00106 ValueTrackerAttributes valueTrackerAttributes( const QModelIndex & index ) const;
00107
00108
00109
00110 const int numberOfAbscissaSegments () const;
00111
00112 const int numberOfOrdinateSegments () const;
00113
00114 protected:
00115 void paint ( PaintContext* paintContext );
00116
00117 public:
00118 void resize ( const QSizeF& area );
00119
00120 protected:
00121
00122 double valueForCellTesting( int row, int column,
00123 bool& bOK,
00124 bool showHiddenCellsAsInvalid = false ) const;
00125 LineAttributes::MissingValuesPolicy getCellValues(
00126 int row, int column,
00127 bool shiftCountedXValuesByHalfSection,
00128 double& valueX, double& valueY ) const;
00129
00130 virtual double threeDItemDepth( const QModelIndex & index ) const;
00131 virtual double threeDItemDepth( int column ) const;
00133 virtual const QPair<QPointF, QPointF> calculateDataBoundaries() const;
00134 void paintEvent ( QPaintEvent* );
00135 void resizeEvent ( QResizeEvent* );
00136 };
00137
00138 }
00139
00140 #endif // KDCHARTLINEDIAGRAM_H