kchart
KDChartTableDataBase Class Reference
#include <KDChartTableBase.h>
Inheritance diagram for KDChartTableDataBase:

Detailed Description
KD Chart's build-in table data for an easy way of storing data values.
- Note:
- To create your data table you would not use a
KDChartTableDataBase
but instantiate the classKDChartTableData
. TheKDChartTableData
class is an auxiliary class: depending on your Qt version it will be mapped onto aKDChartVectorTableData
or onto aKDChartListTableData
both of which are derived fromKDChartTableDataBase
and implement all of its functions. Thus you would create a table of 3 datasets with 25 cells each like this:KDChartTableData myData( 3, 25 );
setCell()
. Cell specific properties may be specified via setCellProp()
.You may adjust or modify your table like this:
- Entering the data can be done either manually using
setCell()
or by passing a QTable to theimportFromQTable()
function.
- Performance of KD Chart can be increased by specifying the number of rows and or the number of columns actually used:
setUsedRows()
and/orsetUsedCols()
prevents KD Chart from iterating over thousands of empty rows/cols that might follow your data cells in case your table is much bigger than needed.
- In case you want to increase your table's size without using the data stored in it please call the
expand()
function with the new total number of rows and cells.
- Accessing one data cell is possible via
cellCoord()
and viacellProp()
, e.g. you might assign a special property set ID to all cells with a future absicssa axis value:const QDateTime currentTime( QDateTime::currentDateTime() ); for( int iCell = 0; iCell < usedValues; ++iCell ){ KDChartData& cell = myData.cell( 0, iCell ); // assign special property set ID if X value is in the future if( cell.isDateTime( 2 ) && cell.dateTimeValue( 2 ) > currentTime ) cell.setPropertySet( idProp_FutureValues ); }
- Note:
- All of the other functions provided by KDChartTableDataBase are either used internally by KD Chart or they are const methods returning some usefull figures like the sum of all values in a row...
Definition at line 87 of file KDChartTableBase.h.
Public Slots | |
virtual uint | rows () const =0 |
virtual uint | cols () const =0 |
virtual void | setCell (uint _row, uint _col, const QVariant &_value1, const QVariant &_value2=QVariant())=0 |
virtual void | setProp (uint _row, uint _col, int _propSet=0)=0 |
virtual bool | cellCoord (uint _row, uint _col, QVariant &_value, int coordinate=1) const =0 |
virtual QVariant | cellVal (uint _row, uint _col, int coordinate=1) const |
virtual bool | cellProp (uint _row, uint _col, int &_prop) const =0 |
virtual void | expand (uint _rows, uint _cols)=0 |
virtual bool | cellContent (uint _row, uint _col, QVariant &_value1, QVariant &_value2, int &_prop) const |
virtual bool | cellCoords (uint _row, uint _col, QVariant &_value1, QVariant &_value2) const |
virtual void | setUsedRows (uint _rows) |
virtual uint | usedRows () const |
virtual void | setUsedCols (uint _cols) |
virtual uint | usedCols () const |
virtual uint | colsScrolledBy () const |
virtual void | setSorted (bool sorted) |
virtual bool | sorted () const |
virtual bool | isPosInfinite (double value) const |
virtual bool | isNegInfinite (double value) const |
virtual bool | isNormalDouble (double value) const |
bool | isNormalDouble (QVariant value, double &dVal) const |
virtual void | importFromQTable (QTable *table) |
virtual double | maxValue (int coordinate=1) const |
virtual double | minValue (int coordinate=1, bool bOnlyGTZero=false) const |
virtual QDateTime | maxDtValue (int coordinate=1) const |
virtual QDateTime | minDtValue (int coordinate=1) const |
virtual double | maxColSum (int coordinate=1) const |
virtual double | minColSum (int coordinate=1) const |
virtual double | maxColSum (uint row, uint row2, int coordinate=1) const |
virtual double | minColSum (uint row, uint row2, int coordinate=1) const |
virtual double | colSum (uint col, int coordinate=1) const |
virtual double | colAbsSum (uint col, int coordinate=1) const |
virtual double | maxRowSum (int coordinate=1) const |
virtual double | minRowSum (int coordinate=1) const |
virtual double | rowSum (uint row, int coordinate=1) const |
virtual double | rowAbsSum (uint row, int coordinate=1) const |
virtual double | maxInColumn (uint col, int coordinate=1) const |
virtual double | minInColumn (uint col, int coordinate=1) const |
virtual double | maxInRow (uint row, int coordinate=1) const |
virtual double | minInRow (uint row, int coordinate=1) const |
virtual double | maxInRows (uint row, uint row2, int coordinate=1) const |
virtual double | minInRows (uint row, uint row2, int coordinate=1, bool bOnlyGTZero=false) const |
virtual QDateTime | maxDtInRows (uint row, uint row2, int coordinate=1) const |
virtual QDateTime | minDtInRows (uint row, uint row2, int coordinate=1) const |
virtual uint | lastPositiveCellInColumn (uint col, int coordinate=1) const |
virtual bool | cellsHaveSeveralCoordinates (QVariant::Type *type2Ref) const |
virtual bool | cellsHaveSeveralCoordinates (uint row1=0, uint row2=UINT_MAX, QVariant::Type *type2Ref=NULL) const |
virtual QVariant::Type | cellsValueType (uint row1, uint row2=UINT_MAX, int coordinate=1) const |
virtual QVariant::Type | cellsValueType (int coordinate=1) const |
Public Member Functions | |
KDChartTableDataBase () | |
KDChartTableDataBase (const KDChartTableDataBase &other) | |
virtual | ~KDChartTableDataBase () |
Protected Attributes | |
bool | _useUsedRows |
bool | _useUsedCols |
Constructor & Destructor Documentation
|
Default constructor. Creates an empty table and sets the sorted flag to false. Definition at line 96 of file KDChartTableBase.h. |
|
Default copy constructor. Just initializes the QObject part of this class and copies the sorted flag. Definition at line 106 of file KDChartTableBase.h. |
|
Default destructor. Does nothing, only defined to have it virtual. Definition at line 119 of file KDChartTableBase.h. |
Member Function Documentation
|
Definition at line 269 of file KDChartTableBase.h. |
|
Returns one of the coordinate data value(s) stored in a cell.
Implemented in KDChartListTableData, and KDChartVectorTableData. |
|
Definition at line 283 of file KDChartTableBase.h. |
|
Returns the property set ID stored in a cell.
Implemented in KDChartListTableData, and KDChartVectorTableData. |
|
Returns one of the coordinate data value(s) stored in a cell. This convenience method calls the bool cellCoord() function and returns the result if it returned successfully - otherwise it returns an invalid QVariant.
Definition at line 218 of file KDChartTableBase.h. |
|
Returns the number of cols in the table.
Implemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData. |
|
Returns the number of cols the table has been scrolled by. Default implementation of this always returns zero, so make sure to return the appropriate value if your class derived from KDChartTableDataBase is supporting internal data scrolling technics. See the KD Chart Programmers Manual for details described in the Data Scrolling chapter.
Definition at line 347 of file KDChartTableBase.h. |
|
Increases the number of rows (and/or columns, resp. ) stored in this table.
Implemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData. |
|
Returns true if the given value represents a negative infinite value.
Definition at line 393 of file KDChartTableBase.h. |
|
Returns true if the given QVariant value represents a normal double value.
This method tests if
Definition at line 429 of file KDChartTableBase.h. |
|
Returns true if the given value represents a normal double value. Normal double values are defined as values that are neither positive infinite nor negative infinite. This method is provided to let derived classed use their own way to determine when a double value is to be threated as normal.
Definition at line 410 of file KDChartTableBase.h. |
|
Returns true if the given value represents a positive infinite value.
Definition at line 377 of file KDChartTableBase.h. |
|
Returns the number of rows in the table.
Implemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData. |
|
Stores data in a cell.
Implemented in KDChartListTableData, and KDChartVectorTableData. |
|
Specifies the property set ID for a cell.
Implemented in KDChartListTableData, and KDChartVectorTableData. |
|
Specified whether the table is sorted.
Definition at line 770 of file KDChartTableBase.cpp. |
|
Sets the number of cols in the table that actually contain data.
Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData. Definition at line 100 of file KDChartTableBase.cpp. |
|
Sets the number of rows in the table that actually contain data.
Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData. Definition at line 93 of file KDChartTableBase.cpp. |
|
Returns whether the table is sorted.
Definition at line 774 of file KDChartTableBase.cpp. |
|
Returns the number of cols in the table that actually contain data.
Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData. Definition at line 104 of file KDChartTableBase.cpp. |
|
Returns the number of rows in the table that actually contain data.
Reimplemented in KDChartListTableData, KDChartSeriesCollection, and KDChartVectorTableData. Definition at line 97 of file KDChartTableBase.cpp. |
The documentation for this class was generated from the following files: