kchart
KDChartPlaneSeries.cpp00001
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
00031 #include "KDChartPlaneSeries.h"
00032
00033 KDChartPlaneSeries::KDChartPlaneSeries( bool isX, double location )
00034 {
00035 setXAxis(isX);
00036 setLocation(location);
00037 }
00038
00039 KDChartPlaneSeries::~KDChartPlaneSeries()
00040 {
00041 }
00042
00043
00044 uint KDChartPlaneSeries::rows() const
00045 {
00046 return 2;
00047 }
00048
00049
00050 const KDChartData& KDChartPlaneSeries::cell( uint row ) const
00051 {
00052 switch (row)
00053 {
00054 case 0: return _start;
00055 case 1: return _stop;
00056 default: Q_ASSERT(0);
00057 return _start;
00058 }
00059 }
00060
00061 void KDChartPlaneSeries::setCell( uint row, const KDChartData& element)
00062 {
00063 Q_ASSERT(0);
00064
00065 row = (uint)element.doubleValue();
00066 }
00067
00068 void KDChartPlaneSeries::expand( uint rows )
00069 {
00070 Q_ASSERT(0);
00071
00072 rows = 0;
00073 }
00074
00075
00076
00077
00078 bool KDChartPlaneSeries::isXAxis() const
00079 {
00080 return _isX;
00081 }
00082
00083 double KDChartPlaneSeries::location() const
00084 {
00085 return _location;
00086 }
00087
00088 void KDChartPlaneSeries::setXAxis( bool isX )
00089 {
00090 _isX = isX;
00091 update();
00092 }
00093
00094 void KDChartPlaneSeries::setLocation( double location )
00095 {
00096 _location = location;
00097 update();
00098 }
00099
00100
00101
00102 void KDChartPlaneSeries::update()
00103 {
00104 if ( _isX )
00105 {
00106 _start = KDChartData( DBL_MIN, _location );
00107 _stop = KDChartData( DBL_MAX, _location );
00108 }
00109 else
00110 {
00111 _start = KDChartData( _location, DBL_MIN );
00112 _stop = KDChartData( _location, DBL_MAX );
00113 }
00114 }
00115
00116
00117
00118
00119 double KDChartPlaneSeries::maxValue( int coordinate, bool &ok ) const
00120 {
00121
00122
00123 if ( _isX == (coordinate==0) )
00124 {
00125 ok = false;
00126 return 0;
00127 }
00128
00129 ok = true;
00130 return _location;
00131 }
00132
00133
00134
00135 double KDChartPlaneSeries::minValue( int coordinate, bool &ok ) const
00136 {
00137 return maxValue(coordinate,ok);
00138 }
|