kchart
KDChartParams.h File Reference
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.
#include <qapplication.h>
#include <qfont.h>
#include <qcolor.h>
#include <qpen.h>
#include <qmap.h>
#include <qdict.h>
#include <qintdict.h>
#include <qobject.h>
#include <qtextstream.h>
#include <qsimplerichtext.h>
#include <qdom.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"
#include <qarray.h>
Go to the source code of this file.
Classes | |
class | KDChartAutoColor |
class | KDChartParams |
Bundles the display parameters of a chart. More... | |
class | KDChartParams::KDChartFrameSettings |
Stores the frame settings for one of the chart areas:. More... | |
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 |
Defines | |
#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()) |
Typedefs | |
typedef QIntDict< KDChartPropertySet > | KDChartPropertySetList |
Functions | |
QTextStream & | operator<< (QTextStream &s, const KDChartParams &p) |
QTextStream & | operator>> (QTextStream &s, KDChartParams &p) |
Define Documentation
|
Our charts may have up to 4 ordinate axes: 2 left ones and 2 right ones.
Definition at line 110 of file KDChartParams.h. |
|
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 113 of file KDChartParams.h. |
|
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 Qt::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, Qt::AlignLeft | Qt::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, Qt::NoPen); horiProps.setShowMarker( KDChartPropertySet::OwnID, false ); horiProps.setExtraMarkersAlign( KDChartPropertySet::OwnID, Qt::AlignLeft | Qt::AlignRight ); horiProps.setExtraMarkersAlign( KDChartPropertySet::OwnID, Qt::AlignLeft | Qt::AlignRight ); setProperties(KDCHART_PROPSET_HORI_LINE, horiProps); }
Definition at line 97 of file KDChartParams.h. |
|
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(...).
Definition at line 95 of file KDChartParams.h. |
|
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 Qt::NoPen. Use this IDs without previously defining a respective set of properties via KDChartParams::registerProperties(...).
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, Qt::NoPen); transpProps.setShowMarker( KDCHART_PROPSET_NORMAL_DATA, bDummy); setProperties(KDCHART_PROPSET_TRANSPARENT_DATA, transpProps); }
Definition at line 96 of file KDChartParams.h. |
|
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 Qt::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, Qt::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, Qt::NoPen); vertProps.setShowMarker( KDChartPropertySet::OwnID, false ); vertProps.setExtraMarkersAlign( KDChartPropertySet::OwnID, Qt::AlignTop ); vertProps.setExtraMarkersAlign( KDChartPropertySet::OwnID, Qt::AlignTop ); setProperties(KDCHART_PROPSET_VERT_LINE, vertProps); }
// 1. specify and register the new property set KDChartPropertySet dataWithTopLineProps; dataWithTopLineProps.setName( "normal data with red vertical line on top"); dataWithTopLineProps.setExtraLinesAlign( KDChartPropertySet::OwnID, Qt::AlignTop ); dataWithTopLineProps.setExtraLinesWidth( KDChartPropertySet::OwnID, -2 ); dataWithTopLineProps.setExtraLinesColor( KDChartPropertySet::OwnID, Qt::red ); dataWithTopLineProps.setExtraLinesStyle( KDChartPropertySet::OwnID, Qt::SolidLine ); dataWithTopLineProps.setExtraMarkersAlign( KDChartPropertySet::OwnID, Qt::AlignTop ); dataWithTopLineProps.setExtraMarkersSize( KDChartPropertySet::OwnID, QSize(-10, -10) ); dataWithTopLineProps.setExtraMarkersColor( KDChartPropertySet::OwnID, Qt::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 );
Definition at line 98 of file KDChartParams.h. |
Function Documentation
|
Writes the KDChartParams object p as an XML document to the text stream s.
Definition at line 42 of file KDChartParams_io.cpp. |
|
Reads the an XML document from the text stream s into the KDChartParams object p.
Definition at line 1039 of file KDChartParams_io.cpp. |