kchart

KDChartParamsWrapper.h
1#ifndef KDCHARTPARAMSWRAPPER_H
2#define KDCHARTPARAMSWRAPPER_H
3#include <tqobject.h>
4#include <KDFrame.h>
5#include <KDChartParams.h>
6#include <tqvariant.h>
8
9class KDChartParamsWrapper :public TQObject
10{
11 TQ_OBJECT
12
13
14public:
15 KDChartParamsWrapper( KDChartParams* );
16public slots:
17 const KDChartAxisParams* axisParams( uint n ) const;
18 void setExplodeValues( TQVariant explodeList );
19 void setExplodeFactors( TQVariant factors );
20 void setAxisLabelStringParams( uint n,
21 TQVariant axisLabelStringList,
22 TQVariant axisShortLabelStringList,
23 const TQString& valueStart = TQString(),
24 const TQString& valueEnd = TQString() );
25
26 // These methods need to be here, for the enums to work.
27 void setSimpleFrame( uint area,
28 int outerGapX = 0,
29 int outerGapY = 0,
30 int innerGapX = 0,
31 int innerGapY = 0,
32 bool addFrameWidthToLayout = true,
33 bool addFrameHeightToLayout = true,
34 int simpleFrame = KDFrame::FrameFlat,
35 int lineWidth = 1,
36 int midLineWidth = 0,
37 TQPen pen = TQPen(),
38 TQBrush background = TQBrush( TQt::NoBrush ),
39 const TQPixmap* backPixmap = 0, // no pixmap
40 int backPixmapMode = KDFrame::PixStretched,
41 int shadowWidth = 0,
42 int sunPos = KDFrame::CornerTopLeft )
43 {
44 _data->setSimpleFrame(area, outerGapX, outerGapY, innerGapX, innerGapY, addFrameWidthToLayout, addFrameHeightToLayout,
45 (KDFrame::SimpleFrame) simpleFrame, lineWidth, midLineWidth, pen, background, backPixmap,
46 (KDFrame::BackPixmapMode) backPixmapMode, shadowWidth, (KDFrame::CornerName) sunPos );
47 }
48
49 void setDataRegionFrame( uint dataRow,
50 uint dataCol,
51 uint data3rd, // important: we ignore the data3rd parameter for now!
52 int innerGapX = 0,
53 int innerGapY = 0,
54 bool addFrameWidthToLayout = true,
55 bool addFrameHeightToLayout = true,
56 int simpleFrame = KDFrame::FrameFlat,
57 int lineWidth = 1,
58 int midLineWidth = 0,
59 TQPen pen = TQPen(),
60 int shadowWidth = 0,
61 int sunPos = KDFrame::CornerTopLeft )
62 {
63 _data->setDataRegionFrame( dataRow, dataCol,
64 data3rd, innerGapX, innerGapY, addFrameWidthToLayout, addFrameHeightToLayout,
65 (KDFrame::SimpleFrame) simpleFrame, lineWidth, midLineWidth, pen, shadowWidth, (KDFrame::CornerName) sunPos );
66 }
67
68 bool moveDataRegionFrame( uint oldDataRow,
69 uint oldDataCol,
70 uint oldData3rd, // important: we ignore the data3rd parameter for now!
71 uint newDataRow,
72 uint newDataCol,
73 uint newData3rd// important: we ignore the data3rd parameter for now!
74 )
75 {
76 return _data->moveDataRegionFrame(
77 oldDataRow, oldDataCol, oldData3rd, newDataRow, newDataCol, newData3rd );
78 }
79
80 void setPrintDataValues( bool active,
81 uint chart = KDCHART_ALL_CHARTS,
82 int divPow10 = 0,
83 int digitsBehindComma = KDCHART_DATA_VALUE_AUTO_DIGITS,
84 TQFont* font = 0,
85 uint size = UINT_MAX, // <-- makes us use the *default* font params
86 // by IGNORING settings of
87 // the following parameters!
88 const TQColor* color = KDCHART_DATA_VALUE_AUTO_COLOR,
89 int negativePosition = KDChartEnums::PosCenter,
90 uint negativeAlign = TQt::AlignCenter,
91 int negativeDeltaX = 0,
92 int negativeDeltaY = 0,
93 int negativeRotation = 0,
94 int positivePosition = KDChartEnums::PosCenter,
95 uint positiveAlign = TQt::AlignCenter,
96 int positiveDeltaX = 0,
97 int positiveDeltaY = 0,
98 int positiveRotation = 0,
99 int policy = KDChartEnums::LayoutPolicyRotate )
100 {
101 _data->setPrintDataValues( active, chart, divPow10, digitsBehindComma,font, size, color, (KDChartEnums::PositionFlag) negativePosition,
102 negativeAlign, negativeDeltaX, negativeDeltaY, negativeRotation, (KDChartEnums::PositionFlag) positivePosition,
103 positiveAlign, positiveDeltaX, positiveDeltaY, positiveRotation, (KDChartEnums::TextLayoutPolicy) policy );
104 }
105
106
107 void setDataValuesPlacing( int position,
108 uint align,
109 int deltaX,
110 int deltaY,
111 int rotation,
112 bool specifyingPositiveValues = true,
113 uint chart = KDCHART_ALL_CHARTS )
114 {
115 _data->setDataValuesPlacing( (KDChartEnums::PositionFlag) position, align, deltaX, deltaY, rotation, specifyingPositiveValues, chart );
116 }
117
118
119 void setDataValuesPolicy( int policy = KDChartEnums::LayoutPolicyRotate,
120 uint chart = KDCHART_ALL_CHARTS )
121 {
122 _data->setDataValuesPolicy( (KDChartEnums::TextLayoutPolicy) policy, chart );
123 }
124
125
126 void setPolarDelimsAndLabelsAtPos( int pos,
127 bool showDelimiters,
128 bool showLabels )
129 {
130 _data->setPolarDelimsAndLabelsAtPos( (KDChartEnums::PositionFlag) pos, showDelimiters, showLabels );
131 }
132
133
134 bool polarDelimAtPos( int pos ) const
135 {
136 return _data->polarDelimAtPos( (KDChartEnums::PositionFlag) pos );
137 }
138
139
140
141 bool polarLabelsAtPos( int pos ) const
142 {
143 return _data->polarLabelsAtPos( (KDChartEnums::PositionFlag) pos );
144 }
145
146
147 void setAxisType( uint n, int axisType )
148 {
149 _data->setAxisType( n, (KDChartAxisParams::AxisType) axisType );
150 }
151
152
153 void setAxisLabelTextParams( uint n,
154 bool axisSteadyValueCalc = true,
155 TQVariant axisValueStart = KDCHART_AXIS_LABELS_AUTO_LIMIT,
156 TQVariant axisValueEnd = KDCHART_AXIS_LABELS_AUTO_LIMIT,
157 double axisValueDelta = KDCHART_AXIS_LABELS_AUTO_DELTA,
158 int axisDigitsBehindComma = KDCHART_AXIS_LABELS_AUTO_DIGITS,
159 int axisMaxEmptyInnerSpan = 67,
160 int takeLabelsFromDataRow = KDChartAxisParams::LabelsFromDataRowNo,
161 int labelTextsDataRow = 0,
162 const TQVariant& axisLabelStringList = TQStringList(),
163 const TQVariant& axisShortLabelsStringList = TQStringList(),
164 int axisValueLeaveOut = KDCHART_AXIS_LABELS_AUTO_LEAVEOUT,
165 int axisValueDeltaScale = KDChartAxisParams::ValueScaleNumerical );
166
167
168
169private:
170 KDChartParams* _data;
171};
172
173
174
175#endif /* KDCHARTPARAMSWRAPPER_H */
176
#define KDCHART_AXIS_LABELS_AUTO_LIMIT
Use this to specify that the axis label limits are to be calculated automatically.
#define KDCHART_AXIS_LABELS_AUTO_DELTA
Use this to specify that the step-width from one label to the other shall be calculated automatically...
#define KDCHART_AXIS_LABELS_AUTO_LEAVEOUT
Use this to specify that an automatically computed amount of axis labels are to be skipped if there i...
#define KDCHART_AXIS_LABELS_AUTO_DIGITS
Use this to specify that the number of digits to be shown on the axis labels behind the comma is to b...
Header for all common chart parameters.
Header of the KDFrame class providing highly configurable rectangular frame drawing.
access the chart axis parameters.
TextLayoutPolicy
Text layout policy: what to do if text that is to be drawn would cover neighboring text or neighborin...
PositionFlag
The general position flag to specify a point of an area, for example this could be the anchor point w...
Bundles the display parameters of a chart.
BackPixmapMode
These are ways how to display a pixmap that might be painted into the inner area.
Definition KDFrame.h:109
SimpleFrame
These simple frames are pre-defined for your convenience.
Definition KDFrame.h:177