kchart

KDChartData Class Reference

List of all members.

Detailed Description

Encapsulates one data cell in a chart.

Data cells either hold one value for the ordinate axis or they hold two values: one for the ordinate axis and an extra one for the abscissa axis.

Ordinate values can either be of type double or non-existant, abscissa values can either be of type double or QDateTime or non-existant.

Note:
All methods returning one of the data values (or one of the data types, resp.) expect a valNo parameter with either a 1 for the first value (the Y or ordinate value) or a 2 for the second value (the X or abscissa value).

Definition at line 47 of file KDChartDataIntern.h.


Public Member Functions

 KDChartData ()
 KDChartData (double value)
 KDChartData (const QString &value)
 KDChartData (double yValue, QDateTime xValue)
 KDChartData (const QVariant &_value1, const QVariant &_value2)
 KDChartData (double yValue, double xValue)
bool operator== (const KDChartData &it) const
bool operator!= (const KDChartData &it) const
bool isEqual (const KDChartData &a, const KDChartData &b) const
void setAll (const KDChartData &R)
void setData (const KDChartData &R)
QVariant::Type valueType (int valNo=1) const
bool hasValue (int valNo=1) const
bool isString (int valNo=1) const
bool isDouble (int valNo=1) const
bool isDateTime (int valNo=1) const
void clearValue ()
QVariant value (int valNo=1) const
QString stringValue (int valNo=1) const
double doubleValue (int valNo=1) const
QDateTime dateTimeValue (int valNo=1) const
void setPropertySet (int propSetID=0)
int propertySet () const

Constructor & Destructor Documentation

KDChartData::KDChartData (  )  [inline]

Constructor.

Creates a KDChartData object that represents no value.

Definition at line 52 of file KDChartDataIntern.h.

KDChartData::KDChartData ( double  value  )  [inline]

Constructor.

Assigns a double value to this object.

Parameters:
value the double value which this object should represent.

Definition at line 60 of file KDChartDataIntern.h.

KDChartData::KDChartData ( const QString &  value  )  [inline]

Constructor.

Assigns a string value to this object.

This data type may be used to store axis labels or legend texts in extra data cells.

Parameters:
value the string value which this object should represent

Definition at line 66 of file KDChartDataIntern.h.

KDChartData::KDChartData ( double  yValue,
QDateTime  xValue 
) [inline]

Constructor.

Assigns a double value and a QDateTime value to this object.

Parameters:
yValue the double value which this object should represent.
xValue the position on the abscissa axis which this object should be assigned to.

Definition at line 82 of file KDChartDataIntern.h.

KDChartData::KDChartData ( double  yValue,
double  xValue 
) [inline]

Constructor.

Assigns two double values to this object.

Parameters:
yValue the double value which this object should represent.
xValue the position on the abscissa axis which this object should be assigned to.

Definition at line 134 of file KDChartDataIntern.h.


Member Function Documentation

bool KDChartData::operator== ( const KDChartData it  )  const [inline]

Compare operator.

See also:
isEqual

Definition at line 173 of file KDChartDataIntern.h.

bool KDChartData::operator!= ( const KDChartData it  )  const [inline]

Compare operator.

See also:
isEqual

Definition at line 183 of file KDChartDataIntern.h.

bool KDChartData::isEqual ( const KDChartData a,
const KDChartData b 
) const [inline]

Compare method.

Note:
The property set ID is not taken into account while comparing. Two KDChartData are considered equal if their data values are equal - the property set ID is ignored.

Definition at line 195 of file KDChartDataIntern.h.

void KDChartData::setAll ( const KDChartData R  )  [inline]

Method setAll.

Note:
The property set ID is also changed by the setAll method.
See also:
setData

Definition at line 246 of file KDChartDataIntern.h.

void KDChartData::setData ( const KDChartData R  )  [inline]

Method setData.

Note:
The property set ID is not changed by the setData method. If you want to set it please call KDChartData::setPropertySet() explicitely.
See also:
setAll

Definition at line 261 of file KDChartDataIntern.h.

KDChartData::ValueType KDChartData::valueType ( int  valNo = 1  )  const [inline]

Returns the type of the respective value.

Parameters:
valNo specifies the value number: 1 means the Y value, 2 means the X value
Returns:
the type of the respective value

Definition at line 296 of file KDChartDataIntern.h.

bool KDChartData::hasValue ( int  valNo = 1  )  const [inline]

Returns true if the object represents a value (double or QString) and false otherwise.

Returns:
true if the object represents a value

Definition at line 302 of file KDChartDataIntern.h.

bool KDChartData::isString ( int  valNo = 1  )  const [inline]

Returns true if the object represents a QString value and false otherwise.

Returns:
true if the object represents a QString value

Definition at line 309 of file KDChartDataIntern.h.

bool KDChartData::isDouble ( int  valNo = 1  )  const [inline]

Returns true if the object represents a double value and false otherwise.

Returns:
true if the object represents a double value

Definition at line 315 of file KDChartDataIntern.h.

bool KDChartData::isDateTime ( int  valNo = 1  )  const [inline]

Returns true if the object represents a QDateTime value and false otherwise.

Returns:
true if the object represents a QDateTime value

Definition at line 321 of file KDChartDataIntern.h.

void KDChartData::clearValue (  )  [inline]

Resets both of the data types of this cell to KDChartData::NoValue and sets the property set ID to KDCHART_PROPSET_NORMAL_DATA.

Definition at line 329 of file KDChartDataIntern.h.

QString KDChartData::stringValue ( int  valNo = 1  )  const [inline]

Returns the string value represented by this object, or QString::null if this object does not represent a string value.

You may use isString() to check if it is appropriate to call this function.

Note:
String values may be used to store axis labels or legend texts in extra data cells.
Returns:
the string value represented by this object, or QString::null if this object does not represent a string value

Definition at line 363 of file KDChartDataIntern.h.

double KDChartData::doubleValue ( int  valNo = 1  )  const [inline]

Returns the double value represented by this object, or DBL_MIN if this object does not represent a double value.

You may use isDouble() or isNormalDouble() to check if it is appropriate to call this function.

Returns:
the double value represented by this object, or DBL_MIN if this object does not represent a double value

Definition at line 372 of file KDChartDataIntern.h.

QDateTime KDChartData::dateTimeValue ( int  valNo = 1  )  const [inline]

Returns the QDateTime value represented by this object, or QDateTime() if this object does not represent a QDateTime value.

You may use isDateTime() to check if it is appropriate to call this function.

Returns:
the QDateTime value represented by this object, or QDateTime() if this object does not represent a QDateTime value

Definition at line 378 of file KDChartDataIntern.h.

void KDChartData::setPropertySet ( int  propSetID = 0  )  [inline]

Assign a property set to a data cell.

Parameters:
propSetID The ID of the property set to be assigned to this data cell. This ID can either be one of the built-in IDs documented at KDChartPropertySet::BuiltinDataPropertySetIDs or a special ID that was given back by a KDChartParams::registerProperties function call.
See also:
propertySet

KDCHART_PROPSET_NORMAL_DATA, KDCHART_PROPSET_TRANSPARENT_DATA

Definition at line 397 of file KDChartDataIntern.h.

int KDChartData::propertySet (  )  const [inline]

Return the ID of the property set that is assigned to this data cell.

Use KDChartParams::properties( int ID ) for accessing the respective property set information.

See also:
setPropertySet

KDCHART_PROPSET_NORMAL_DATA, KDCHART_PROPSET_TRANSPARENT_DATA

Definition at line 409 of file KDChartDataIntern.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys