#include <tqapplication.h>#include <tqfont.h>#include <tqcolor.h>#include <tqpen.h>#include <tqmap.h>#include <tqdict.h>#include <tqintdict.h>#include <tqobject.h>#include <tqtextstream.h>#include <tqsimplerichtext.h>#include <tqdom.h>#include <tqvaluevector.h>#include <limits.h>#include <math.h>#include "KDChartGlobal.h"#include "KDChartEnums.h"#include "KDChartCustomBox.h"#include "KDFrame.h"#include "KDChartAxisParams.h"#include "KDChartPropertySet.h"Go to the source code of this file.
Classes | |
| class | KDChartParams |
| class | KDChartParams::KDChartFrameSettings |
Macros | |
| #define | KDCHART_ALL_AXES UINT_MAX-1 |
| #define | KDCHART_NO_AXIS UINT_MAX |
| #define | KDCHART_ALL_DATASETS UINT_MAX - 1 |
| #define | KDCHART_NO_DATASET UINT_MAX |
| #define | KDCHART_UNKNOWN_CHART UINT_MAX - 2 |
| #define | KDCHART_ALL_CHARTS UINT_MAX - 1 |
| #define | KDCHART_NO_CHART UINT_MAX |
| #define | KDCHART_GLOBAL_LINE_STYLE UINT_MAX |
| #define | KDCHART_AUTO_SIZE INT_MAX |
| #define | KDCHART_DATA_VALUE_AUTO_DIGITS INT_MAX |
| #define | KDCHART_SAGITTAL_ROTATION INT_MAX |
| #define | KDCHART_TANGENTIAL_ROTATION INT_MAX - 1 |
| #define | KDCHART_SAGGITAL_ROTATION INT_MAX |
| #define | KDCHART_CNT_ORDINATES 4 |
| #define | KDCHART_MAX_POLAR_DELIMS_AND_LABELS_POS 8 |
| #define | KDCHART_DATA_VALUE_AUTO_COLOR (KDChartAutoColor::instance()->color()) |
General parameters. | |
These methods set general parameters that apply to several or all chart types. | |
| #define | KDCHART_PROPSET_NORMAL_DATA 0 |
| #define | KDCHART_PROPSET_TRANSPARENT_DATA 1 |
| #define | KDCHART_PROPSET_HORI_LINE 2 |
| #define | KDCHART_PROPSET_VERT_LINE 3 |
| #define | KDCHART_MAX_AXES 12 |
Typedefs | |
| typedef TQIntDict< KDChartPropertySet > | KDChartPropertySetList |
Functions | |
| TQTextStream & | operator<< (TQTextStream &s, const KDChartParams &p) |
| TQTextStream & | operator>> (TQTextStream &s, KDChartParams &p) |
Detailed Description
Header for all common chart parameters.
This file is used to access all chart parameters except of the axis settings which you will find in KDChartAxisParams.h
- See also
- KDChartAxisParams.h
Definition in file KDChartParams.h.
Macro Definition Documentation
◆ KDCHART_ALL_AXES
| #define KDCHART_ALL_AXES UINT_MAX-1 |
Definition at line 71 of file KDChartParams.h.
◆ KDCHART_ALL_CHARTS
| #define KDCHART_ALL_CHARTS UINT_MAX - 1 |
Definition at line 84 of file KDChartParams.h.
◆ KDCHART_ALL_DATASETS
| #define KDCHART_ALL_DATASETS UINT_MAX - 1 |
Definition at line 80 of file KDChartParams.h.
◆ KDCHART_AUTO_SIZE
| #define KDCHART_AUTO_SIZE INT_MAX |
Definition at line 87 of file KDChartParams.h.
◆ KDCHART_CNT_ORDINATES
| #define KDCHART_CNT_ORDINATES 4 |
Our charts may have up to 4 ordinate axes: 2 left ones and 2 right ones.
Definition at line 106 of file KDChartParams.h.
◆ KDCHART_DATA_VALUE_AUTO_COLOR
| #define KDCHART_DATA_VALUE_AUTO_COLOR (KDChartAutoColor::instance()->color()) |
Definition at line 112 of file KDChartParams.h.
◆ KDCHART_DATA_VALUE_AUTO_DIGITS
| #define KDCHART_DATA_VALUE_AUTO_DIGITS INT_MAX |
Definition at line 88 of file KDChartParams.h.
◆ KDCHART_GLOBAL_LINE_STYLE
| #define KDCHART_GLOBAL_LINE_STYLE UINT_MAX |
Definition at line 86 of file KDChartParams.h.
◆ KDCHART_MAX_AXES
| #define KDCHART_MAX_AXES 12 |
Charts have up to 12 axes: up to two axes on both sides for X, Y and Z (if data is 3-dimensional).
This constant is located here and in KDChartAxisParams, because one KDChartAxisParams object describes only one axis.
Definition at line 109 of file KDChartParams.h.
◆ KDCHART_MAX_POLAR_DELIMS_AND_LABELS_POS
| #define KDCHART_MAX_POLAR_DELIMS_AND_LABELS_POS 8 |
Definition at line 108 of file KDChartParams.h.
◆ KDCHART_NO_AXIS
| #define KDCHART_NO_AXIS UINT_MAX |
Definition at line 79 of file KDChartParams.h.
◆ KDCHART_NO_CHART
| #define KDCHART_NO_CHART UINT_MAX |
Definition at line 85 of file KDChartParams.h.
◆ KDCHART_NO_DATASET
| #define KDCHART_NO_DATASET UINT_MAX |
Definition at line 82 of file KDChartParams.h.
◆ KDCHART_PROPSET_HORI_LINE
| #define KDCHART_PROPSET_HORI_LINE 2 |
Predefined (build-in) property ID.
may be used to specify a special cell which is not part of the normal data but to be used for positioning a separate horizontal line. Data display will be surpressed for this point: neither the data representation nor the connecting line to the next point will be shown, actually the point will remain invisible but a horizontal line will be drawn instead: using line style TQt::DotLine and the respective dataset's line color.
Use this IDs without previously defining a respective set of properties via KDChartParams::registerProperties(...).
In case you want to change this default behavior, use KDChartParams::setProperties(), e.g. the following piece of code still has an invisible line and also does not show the point's marker while now showing two separate markers at the horizontal line's start and end.
KDChartPropertySet horiProps;
if( properties(KDCHART_PROPSET_HORI_LINE,
horiProps) ){
// build-in property was found, let's modify it a bit:
horiProps.setExtraMarkersAlign(
KDChartPropertySet::OwnID,
TQt::AlignLeft | TQt::AlignRight );
setProperties(KDCHART_PROPSET_HORI_LINE,
horiProps);
}else{
// Ooops? The build-in property was NOT found!
// OK, never mind, let's specify it from scratch:
horiProps.setName("horizontal line");
horiProps.setLineStyle(KDChartPropertySet::OwnID, TQt::NoPen);
horiProps.setShowMarker( KDChartPropertySet::OwnID, false );
horiProps.setExtraMarkersAlign( KDChartPropertySet::OwnID,
TQt::AlignLeft | TQt::AlignRight );
horiProps.setExtraMarkersAlign(
KDChartPropertySet::OwnID,
TQt::AlignLeft | TQt::AlignRight );
setProperties(KDCHART_PROPSET_HORI_LINE,
horiProps);
}
- Note
- The example above uses setProperties (in the last line) to define a property set. This is the right way for build-in property sets, but it is not recomended for your additional user-defined property sets: these should be registered with the registerProperties function to initially obtain a unique ID number for your new property set, see the second example given with
KDCHART_PROPSET_VERT_LINE.
- See also
- KDCHART_PROPSET_NORMAL_DATA
- KDCHART_PROPSET_VERT_LINE
- KDChartData::setPropertySet
- KDChartParams::registerProperties, KDChartParams::setProperties, KDChartParams::properties
Definition at line 93 of file KDChartParams.h.
◆ KDCHART_PROPSET_NORMAL_DATA
| #define KDCHART_PROPSET_NORMAL_DATA 0 |
Default (built-in) property ID, used for data cells without any special properties.
Use this IDs without previously defining a respective set of properties via KDChartParams::registerProperties(...).
- Note
- While (in theory) it is possible to assign special property values to this build-in property set this normally might not a very good idea since these values would apply to every(!) data cell that has no other property set assigned. Such general changes would rather be done calling KDChartParam's main functions, e.g. you would invoke KDChartParams::setLineMarker(true) instead of changing the normal-data property set.
- See also
- KDCHART_PROPSET_TRANSPARENT_DATA
- KDCHART_PROPSET_HORI_LINE, KDCHART_PROPSET_VERT_LINE
- KDChartData::setPropertySet
- KDChartParams::registerProperties, KDChartParams::setProperties, KDChartParams::properties
Definition at line 91 of file KDChartParams.h.
◆ KDCHART_PROPSET_TRANSPARENT_DATA
| #define KDCHART_PROPSET_TRANSPARENT_DATA 1 |
Predefined (build-in) property ID.
used to specify a cell that should be displayed using a null pen: neither the data representation nor the connecting line to the next point will be shown, but the line will be drawn using line style TQt::NoPen.
Use this IDs without previously defining a respective set of properties via KDChartParams::registerProperties(...).
- Note
- : Assigning this property to a data cell will result in the cell being invisible: there will be no marker for this point and there will be a 'gap' in this dataset's line from the point to the next one. In case you want to change this default behavior, use KDChartParams::setProperties(), e.g. the following piece of code still has an invisible line while now enabeling showing of the marker - but only if it was set active by KDChartParams::setLineMarker(true).
KDChartPropertySet transpProps;
bool bDummy;
if( properties(KDCHART_PROPSET_TRANSPARENT_DATA,
transpProps) ){
// build-in property was found, let's modify it a bit:
transpProps.setShowMarker(
KDCHART_PROPSET_NORMAL_DATA, bDummy );
setProperties(KDCHART_PROPSET_TRANSPARENT_DATA,
transpProps);
}else{
// Ooops? The build-in property was NOT found!
// OK, never mind, let's specify it from scratch:
transpProps.setName("transparent data");
transpProps.setLineStyle(KDChartPropertySet::OwnID, TQt::NoPen);
transpProps.setShowMarker(
KDCHART_PROPSET_NORMAL_DATA, bDummy);
setProperties(KDCHART_PROPSET_TRANSPARENT_DATA,
transpProps);
}
- Note
- The example above uses setProperties (in the last line) to define a property set. This is the right way for build-in property sets, but it is not recomended for your additional user-defined property sets: these should be registered with the registerProperties function to initially obtain a unique ID number for your new property set, see the second example given with
KDCHART_PROPSET_VERT_LINE.
- See also
- KDCHART_PROPSET_NORMAL_DATA
- KDCHART_PROPSET_HORI_LINE, KDCHART_PROPSET_VERT_LINE
- KDChartData::setPropertySet
- KDChartParams::registerProperties, KDChartParams::setProperties, KDChartParams::properties
Definition at line 92 of file KDChartParams.h.
◆ KDCHART_PROPSET_VERT_LINE
| #define KDCHART_PROPSET_VERT_LINE 3 |
Predefined (build-in) property ID.
may be used to specify a special cell which is not part of the normal data but to be used for positioning a separate vertical line. Data display will be surpressed for this point: neither the data representation nor the connecting line to the next point will be shown, actually the point will remain invisible but a vertical line will be drawn instead: using line style TQt::DotLine and the respective dataset's line color.
Use this IDs without previously defining a respective set of properties via KDChartParams::registerProperties(...).
In case you want to change this default behavior, use KDChartParams::setProperties(), e.g. the following piece of code still has an invisible line and also does not show the point's marker while now showing a separate marker at the top end of the vertical line which will not run across the complete data area but start on the respective point's Y position and go to the top edge of the chart's area.
KDChartPropertySet vertProps;
if( properties(KDCHART_PROPSET_VERT_LINE,
vertProps) ){
// build-in property was found, let's modify it a bit:
vertProps.setExtraMarkersAlign(
KDChartPropertySet::OwnID, TQt::AlignTop );
setProperties(KDCHART_PROPSET_VERT_LINE,
vertProps);
}else{
// Ooops? The build-in property was NOT found!
// OK, never mind, let's specify it from scratch:
vertProps.setName("vertical line");
vertProps.setLineStyle(KDChartPropertySet::OwnID, TQt::NoPen);
vertProps.setShowMarker( KDChartPropertySet::OwnID, false );
vertProps.setExtraMarkersAlign( KDChartPropertySet::OwnID,
TQt::AlignTop );
vertProps.setExtraMarkersAlign(
KDChartPropertySet::OwnID,
TQt::AlignTop );
setProperties(KDCHART_PROPSET_VERT_LINE,
vertProps);
}
- Note
- The example above uses setProperties (in the last line) to define a property set. This is the right way for build-in property sets, but it is not recomended for your additional user-defined property sets: these should be registered with the registerProperties function to initially obtain a unique ID number for your new property set, see the following example:
The code shown below demonstrates how to specify a new property set which then can be used for adding a red vertical line with marker to some of your normal data points:
// 1. specify and register the new property set
KDChartPropertySet dataWithTopLineProps;
dataWithTopLineProps.setName(
"normal data with red vertical line on top");
dataWithTopLineProps.setExtraLinesAlign(
KDChartPropertySet::OwnID,
TQt::AlignTop );
dataWithTopLineProps.setExtraLinesWidth(
KDChartPropertySet::OwnID,
-2 );
dataWithTopLineProps.setExtraLinesColor(
KDChartPropertySet::OwnID,
TQt::red );
dataWithTopLineProps.setExtraLinesStyle(
KDChartPropertySet::OwnID,
TQt::SolidLine );
dataWithTopLineProps.setExtraMarkersAlign(
KDChartPropertySet::OwnID,
TQt::AlignTop );
dataWithTopLineProps.setExtraMarkersSize(
KDChartPropertySet::OwnID,
TQSize(-10, -10) );
dataWithTopLineProps.setExtraMarkersColor(
KDChartPropertySet::OwnID,
TQt::darkRed );
dataWithTopLineProps.setExtraMarkersStyle(
KDChartPropertySet::OwnID,
KDChartParams::LineMarkerCircle );
int idDataWithTopLineProps
= registerProperties( dataWithTopLineProps );
// 2. assign this property set
// to some of your data cells
d = new KDChartTableData( 5, 10 );
// ...
d->cell( 0, 2 ).setPropertySet( idDataWithTopLineProps );
d->cell( 2, 5 ).setPropertySet( idDataWithTopLineProps );
- See also
- KDCHART_PROPSET_NORMAL_DATA
- KDCHART_PROPSET_HORI_LINE
- KDChartData::setPropertySet
- KDChartParams::registerProperties, KDChartParams::setProperties, KDChartParams::properties
Definition at line 94 of file KDChartParams.h.
◆ KDCHART_SAGGITAL_ROTATION
| #define KDCHART_SAGGITAL_ROTATION INT_MAX |
Definition at line 100 of file KDChartParams.h.
◆ KDCHART_SAGITTAL_ROTATION
| #define KDCHART_SAGITTAL_ROTATION INT_MAX |
Definition at line 89 of file KDChartParams.h.
◆ KDCHART_TANGENTIAL_ROTATION
| #define KDCHART_TANGENTIAL_ROTATION INT_MAX - 1 |
Definition at line 90 of file KDChartParams.h.
◆ KDCHART_UNKNOWN_CHART
| #define KDCHART_UNKNOWN_CHART UINT_MAX - 2 |
Definition at line 83 of file KDChartParams.h.
Typedef Documentation
◆ KDChartPropertySetList
| typedef TQIntDict<KDChartPropertySet> KDChartPropertySetList |
Definition at line 69 of file KDChartParams.h.
Function Documentation
◆ operator<<()
| TQTextStream & operator<< | ( | TQTextStream & | s, |
| const KDChartParams & | p ) |
Writes the KDChartParams object p as an XML document to the text stream s.
- Parameters
-
s the text stream to write to p the KDChartParams object to write
- Returns
- the text stream after the write operation
Definition at line 43 of file KDChartParams_io.cpp.
◆ operator>>()
| TQTextStream & operator>> | ( | TQTextStream & | s, |
| KDChartParams & | p ) |
Reads the an XML document from the text stream s into the KDChartParams object p.
- Parameters
-
s the text stream to read from p the KDChartParams object to read into
- Returns
- the text stream after the read operation
Definition at line 1044 of file KDChartParams_io.cpp.
