##// END OF EJS Templates
Added documentation for new properties of QAbstractAxis
Tero Ahola -
r2361:574e4e269d59
parent child
Show More
@@ -1,871 +1,1005
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include "qabstractaxis.h"
21 #include "qabstractaxis.h"
22 #include "qabstractaxis_p.h"
22 #include "qabstractaxis_p.h"
23 #include "chartdataset_p.h"
23 #include "chartdataset_p.h"
24 #include "charttheme_p.h"
24 #include "charttheme_p.h"
25
25
26 QTCOMMERCIALCHART_BEGIN_NAMESPACE
26 QTCOMMERCIALCHART_BEGIN_NAMESPACE
27
27
28 /*!
28 /*!
29 \class QAbstractAxis
29 \class QAbstractAxis
30 \brief The QAbstractAxis class is used for manipulating chart's axis.
30 \brief The QAbstractAxis class is used for manipulating chart's axis.
31 \mainclass
31 \mainclass
32
32
33 There is only one x Axis visible at the time, however there can be multiple y axes.
33 There is only one x Axis visible at the time, however there can be multiple y axes.
34 Each chart series can be bound to exactly one Y axis and the shared common X axis.
34 Each chart series can be bound to exactly one Y axis and the shared common X axis.
35 Axis can be setup to show axis line with tick marks, grid lines and shades.
35 Axis can be setup to show axis line with tick marks, grid lines and shades.
36 */
36 */
37
37
38 /*!
38 /*!
39 \qmlclass AbstractAxis QAbstractAxis
39 \qmlclass AbstractAxis QAbstractAxis
40 \brief The Axis element is used for manipulating chart's axes
40 \brief The Axis element is used for manipulating chart's axes
41
41
42 There is only one x Axis visible at the time, however there can be multiple y axes on a ChartView.
42 There is only one x Axis visible at the time, however there can be multiple y axes on a ChartView.
43 Each chart series can be bound to exactly one Y axis and the shared common X axis.
43 Each chart series can be bound to exactly one Y axis and the shared common X axis.
44 Axis can be setup to show axis line with tick marks, grid lines and shades.
44 Axis can be setup to show axis line with tick marks, grid lines and shades.
45
45
46 To access Axes you can use ChartView API. For example:
46 To access Axes you can use ChartView API. For example:
47 \code
47 \code
48 ChartView {
48 ChartView {
49 axisX.min: 0
49 axisX.min: 0
50 axisX.max: 3
50 axisX.max: 3
51 axisX.ticksCount: 4
51 axisX.ticksCount: 4
52 axisY.min: 0
52 axisY.min: 0
53 axisY.max: 4
53 axisY.max: 4
54 // Add a few series...
54 // Add a few series...
55 }
55 }
56 \endcode
56 \endcode
57 */
57 */
58
58
59 /*!
59 /*!
60 \enum QAbstractAxis::AxisType
60 \enum QAbstractAxis::AxisType
61
61
62 The type of the series object.
62 The type of the series object.
63
63
64 \value AxisTypeNoAxis
64 \value AxisTypeNoAxis
65 \value AxisTypeValue
65 \value AxisTypeValue
66 \value AxisTypeBarCategory
66 \value AxisTypeBarCategory
67 \value AxisTypeCategory
67 \value AxisTypeCategory
68 \value AxisTypeDateTime
68 \value AxisTypeDateTime
69 \value AxisTypeLogValue
69 \value AxisTypeLogValue
70 */
70 */
71
71
72 /*!
72 /*!
73 *\fn void QAbstractAxis::type() const
73 *\fn void QAbstractAxis::type() const
74 Returns the type of the axis
74 Returns the type of the axis
75 */
75 */
76
76
77 /*!
77 /*!
78 \property QAbstractAxis::lineVisible
78 \property QAbstractAxis::lineVisible
79 The visibility of the axis line
79 The visibility of the axis line
80 */
80 */
81 /*!
81 /*!
82 \qmlproperty bool AbstractAxis::lineVisible
82 \qmlproperty bool AbstractAxis::lineVisible
83 The visibility of the axis line
83 The visibility of the axis line
84 */
84 */
85
85
86 /*!
86 /*!
87 \property QAbstractAxis::linePen
88 The pen of the line.
89 */
90
91 /*!
87 \property QAbstractAxis::labelsVisible
92 \property QAbstractAxis::labelsVisible
88 Defines if axis labels are visible.
93 Defines if axis labels are visible.
89 */
94 */
90 /*!
95 /*!
91 \qmlproperty bool AbstractAxis::labelsVisible
96 \qmlproperty bool AbstractAxis::labelsVisible
92 Defines if axis labels are visible.
97 Defines if axis labels are visible.
93 */
98 */
94
99
95 /*!
100 /*!
101 \property QAbstractAxis::labelsPen
102 The pen of the labels.
103 */
104
105 /*!
106 \property QAbstractAxis::labelsBrush
107 The brush of the labels.
108 */
109
110 /*!
96 \property QAbstractAxis::visible
111 \property QAbstractAxis::visible
97 The visibility of the axis.
112 The visibility of the axis.
98 */
113 */
99 /*!
114 /*!
100 \qmlproperty bool AbstractAxis::visible
115 \qmlproperty bool AbstractAxis::visible
101 The visibility of the axis.
116 The visibility of the axis.
102 */
117 */
103
118
104 /*!
119 /*!
105 \property QAbstractAxis::gridVisible
120 \property QAbstractAxis::gridVisible
106 The visibility of the grid lines.
121 The visibility of the grid lines.
107 */
122 */
108 /*!
123 /*!
109 \qmlproperty bool AbstractAxis::gridVisible
124 \qmlproperty bool AbstractAxis::gridVisible
110 The visibility of the grid lines.
125 The visibility of the grid lines.
111 */
126 */
112
127
113 /*!
128 /*!
114 \property QAbstractAxis::color
129 \property QAbstractAxis::color
115 The color of the axis and ticks.
130 The color of the axis and ticks.
116 */
131 */
117 /*!
132 /*!
118 \qmlproperty color AbstractAxis::color
133 \qmlproperty color AbstractAxis::color
119 The color of the axis and ticks.
134 The color of the axis and ticks.
120 */
135 */
121
136
122 /*!
137 /*!
138 \property QAbstractAxis::gridLinePen
139 The pen of the grid line.
140 */
141
142 /*!
123 \property QAbstractAxis::labelsFont
143 \property QAbstractAxis::labelsFont
124 The font of the axis labels.
144 The font of the axis labels.
125 */
145 */
126
146
127 /*!
147 /*!
128 \qmlproperty Font AbstractAxis::labelsFont
148 \qmlproperty Font AbstractAxis::labelsFont
129 The font of the axis labels.
149 The font of the axis labels.
130
150
131 See the \l {Font} {QML Font Element} for detailed documentation.
151 See the \l {Font} {QML Font Element} for detailed documentation.
132 */
152 */
133
153
134 /*!
154 /*!
135 \property QAbstractAxis::labelsColor
155 \property QAbstractAxis::labelsColor
136 The color of the axis labels.
156 The color of the axis labels.
137 */
157 */
138 /*!
158 /*!
139 \qmlproperty color AbstractAxis::labelsColor
159 \qmlproperty color AbstractAxis::labelsColor
140 The color of the axis labels.
160 The color of the axis labels.
141 */
161 */
142
162
143 /*!
163 /*!
144 \property QAbstractAxis::labelsAngle
164 \property QAbstractAxis::labelsAngle
145 The angle of the axis labels in degrees.
165 The angle of the axis labels in degrees.
146 */
166 */
147 /*!
167 /*!
148 \qmlproperty int AbstractAxis::labelsAngle
168 \qmlproperty int AbstractAxis::labelsAngle
149 The angle of the axis labels in degrees.
169 The angle of the axis labels in degrees.
150 */
170 */
151
171
152 /*!
172 /*!
153 \property QAbstractAxis::shadesVisible
173 \property QAbstractAxis::shadesVisible
154 The visibility of the axis shades.
174 The visibility of the axis shades.
155 */
175 */
156 /*!
176 /*!
157 \qmlproperty bool AbstractAxis::shadesVisible
177 \qmlproperty bool AbstractAxis::shadesVisible
158 The visibility of the axis shades.
178 The visibility of the axis shades.
159 */
179 */
160
180
161 /*!
181 /*!
162 \property QAbstractAxis::shadesColor
182 \property QAbstractAxis::shadesColor
163 The fill (brush) color of the axis shades.
183 The fill (brush) color of the axis shades.
164 */
184 */
165 /*!
185 /*!
166 \qmlproperty color AbstractAxis::shadesColor
186 \qmlproperty color AbstractAxis::shadesColor
167 The fill (brush) color of the axis shades.
187 The fill (brush) color of the axis shades.
168 */
188 */
169
189
170 /*!
190 /*!
171 \property QAbstractAxis::shadesBorderColor
191 \property QAbstractAxis::shadesBorderColor
172 The border (pen) color of the axis shades.
192 The border (pen) color of the axis shades.
173 */
193 */
174 /*!
194 /*!
175 \qmlproperty color AbstractAxis::shadesBorderColor
195 \qmlproperty color AbstractAxis::shadesBorderColor
176 The border (pen) color of the axis shades.
196 The border (pen) color of the axis shades.
177 */
197 */
178
198
179 /*!
199 /*!
200 \property QAbstractAxis::shadesPen
201 The pen of the axis shades (area between grid lines).
202 */
203
204 /*!
205 \property QAbstractAxis::shadesBrush
206 The brush of the axis shades (area between grid lines).
207 */
208
209 /*!
180 \property QAbstractAxis::titleVisible
210 \property QAbstractAxis::titleVisible
181 The visibility of the axis title. By default the value is true.
211 The visibility of the axis title. By default the value is true.
182 */
212 */
183 /*!
213 /*!
184 \qmlproperty bool AbstractAxis::titleVisible
214 \qmlproperty bool AbstractAxis::titleVisible
185 The visibility of the axis title. By default the value is true.
215 The visibility of the axis title. By default the value is true.
186 */
216 */
187
217
188 /*!
218 /*!
219 \property QAbstractAxis::titleText
220 The title of the axis. Empty by default.
221 */
222 /*!
223 \qmlproperty String AbstractAxis::titleText
224 The title of the axis. Empty by default.
225 */
226
227 /*!
228 \property QAbstractAxis::titlePen
229 The pen of the title text.
230 */
231
232 /*!
233 \property QAbstractAxis::titleBrush
234 The brush of the title text.
235 */
236
237 /*!
189 \property QAbstractAxis::titleFont
238 \property QAbstractAxis::titleFont
190 The font of the title of the axis.
239 The font of the title of the axis.
191 */
240 */
192 /*!
241 /*!
193 \qmlproperty Font AbstractAxis::title
242 \qmlproperty Font AbstractAxis::titleFont
194 The font of the title of the axis.
243 The font of the title of the axis.
195 */
244 */
196
245
197 /*!
246 /*!
198 \property QAbstractAxis::title
247 \property QAbstractAxis::orientation
199 The title of the axis. Empty by default.
248 The orientation of the axis. Fixed to either Qt::Horizontal or Qt::Vertical when you add the axis to a chart.
200 */
249 */
201 /*!
250 /*!
202 \qmlproperty string AbstractAxis::title
251 \qmlproperty Qt.Orientation AbstractAxis::orientation
203 The title of the axis. Empty string by default.
252 The orientation of the axis. Fixed to either Qt.Horizontal or Qt.Vertical when the axis is set to a Chart/Series.
204 */
253 */
205
254
206 /*!
255 /*!
207 \property QAbstractAxis::alignment
256 \property QAbstractAxis::alignment
208 The alignment of the axis. Either Qt::AlignLeft or Qt::AlignBottom.
257 The alignment of the axis. Either Qt::AlignLeft or Qt::AlignBottom.
209 */
258 */
210 /*!
259 /*!
211 \qmlproperty alignment AbstractAxis::alignment
260 \qmlproperty alignment AbstractAxis::alignment
212 The alignment of the axis. Either Qt.AlignLeft or Qt.AlignBottom.
261 The alignment of the axis. Either Qt.AlignLeft or Qt.AlignBottom.
213 */
262 */
214
263
215 /*!
264 /*!
216 \fn void QAbstractAxis::visibleChanged(bool visible)
265 \fn void QAbstractAxis::visibleChanged(bool visible)
217 Visibility of the axis has changed to \a visible.
266 Visibility of the axis has changed to \a visible.
218 */
267 */
219 /*!
268 /*!
220 \qmlsignal AbstractAxis::onVisibleChanged(bool visible)
269 \qmlsignal AbstractAxis::onVisibleChanged(bool visible)
221 Visibility of the axis has changed to \a visible.
270 Visibility of the axis has changed to \a visible.
222 */
271 */
223
272
224 /*!
273 /*!
274 \fn void QAbstractAxis::linePenChanged(const QPen& pen)
275 The pen of the line of the axis has changed to \a pen.
276 */
277
278 /*!
225 \fn void QAbstractAxis::lineVisibleChanged(bool visible)
279 \fn void QAbstractAxis::lineVisibleChanged(bool visible)
226 Visibility of the axis line has changed to \a visible.
280 Visibility of the axis line has changed to \a visible.
227 */
281 */
228 /*!
282 /*!
229 \qmlsignal AbstractAxis::onLineVisibleChanged(bool visible)
283 \qmlsignal AbstractAxis::onLineVisibleChanged(bool visible)
230 Visibility of the axis line has changed to \a visible.
284 Visibility of the axis line has changed to \a visible.
231 */
285 */
232
286
233 /*!
287 /*!
234 \fn void QAbstractAxis::labelsVisibleChanged(bool visible)
288 \fn void QAbstractAxis::labelsVisibleChanged(bool visible)
235 Visibility of the labels of the axis has changed to \a visible.
289 Visibility of the labels of the axis has changed to \a visible.
236 */
290 */
237 /*!
291 /*!
238 \qmlsignal AbstractAxis::onLabelsVisibleChanged(bool visible)
292 \qmlsignal AbstractAxis::onLabelsVisibleChanged(bool visible)
239 Visibility of the labels of the axis has changed to \a visible.
293 Visibility of the labels of the axis has changed to \a visible.
240 */
294 */
241
295
242 /*!
296 /*!
297 \fn void QAbstractAxis::labelsFontChanged(const QFont& font)
298 The font of the axis labels has changed to \a font.
299 */
300 /*!
301 \qmlsignal AbstractAxis::onLabelsFontChanged(Font font)
302 The font of the axis labels has changed to \a font.
303 */
304
305 /*!
306 \fn void QAbstractAxis::labelsPenChanged(const QPen& pen)
307 The pen of the axis labels has changed to \a pen.
308 */
309
310 /*!
311 \fn void QAbstractAxis::labelsBrushChanged(const QBrush& brush)
312 The brush of the axis labels has changed to \a brush.
313 */
314
315 /*!
316 \fn void QAbstractAxis::labelsAngleChanged(int angle)
317 The angle of the axis labels has changed to \a angle.
318 */
319 /*!
320 \qmlsignal AbstractAxis::onLabelsAngleChanged(int angle)
321 The angle of the axis labels has changed to \a angle.
322 */
323
324 /*!
243 \fn void QAbstractAxis::gridVisibleChanged(bool visible)
325 \fn void QAbstractAxis::gridVisibleChanged(bool visible)
244 Visibility of the grid lines of the axis has changed to \a visible.
326 Visibility of the grid lines of the axis has changed to \a visible.
245 */
327 */
246 /*!
328 /*!
247 \qmlsignal AbstractAxis::onGridVisibleChanged(bool visible)
329 \qmlsignal AbstractAxis::onGridVisibleChanged(bool visible)
248 Visibility of the grid lines of the axis has changed to \a visible.
330 Visibility of the grid lines of the axis has changed to \a visible.
249 */
331 */
250
332
251 /*!
333 /*!
334 \fn void QAbstractAxis::gridLinePenChanged(const QPen& pen)
335 The pen of the grid line has changed to \a pen.
336 */
337
338 /*!
252 \fn void QAbstractAxis::colorChanged(QColor color)
339 \fn void QAbstractAxis::colorChanged(QColor color)
253 Emitted if the \a color of the axis is changed.
340 Emitted if the \a color of the axis is changed.
254 */
341 */
255 /*!
342 /*!
256 \qmlsignal AbstractAxis::onColorChanged(QColor color)
343 \qmlsignal AbstractAxis::onColorChanged(QColor color)
257 Emitted if the \a color of the axis is changed.
344 Emitted if the \a color of the axis is changed.
258 */
345 */
259
346
260 /*!
347 /*!
261 \fn void QAbstractAxis::labelsColorChanged(QColor color)
348 \fn void QAbstractAxis::labelsColorChanged(QColor color)
262 Emitted if the \a color of the axis labels is changed.
349 Emitted if the \a color of the axis labels is changed.
263 */
350 */
264 /*!
351 /*!
265 \qmlsignal AbstractAxis::onLabelsColorChanged(QColor color)
352 \qmlsignal AbstractAxis::onLabelsColorChanged(QColor color)
266 Emitted if the \a color of the axis labels is changed.
353 Emitted if the \a color of the axis labels is changed.
267 */
354 */
268
355
269 /*!
356 /*!
357 \fn void QAbstractAxis::titleVisibleChanged(bool visible)
358 Visibility of the title text of the axis has changed to \a visible.
359 */
360 /*!
361 \qmlsignal AbstractAxis::onTitleVisibleChanged(bool visible)
362 Visibility of the title text of the axis has changed to \a visible.
363 */
364
365 /*!
366 \fn void QAbstractAxis::titleTextChanged(const QString& text)
367 The text of the axis title has changed to \a text.
368 */
369 /*!
370 \qmlsignal AbstractAxis::onTitleTextChanged(String text)
371 The text of the axis title has changed to \a text.
372 */
373
374 /*!
375 \fn void QAbstractAxis::titlePenChanged(const QPen& pen)
376 The pen of the axis shades has changed to \a pen.
377 */
378
379 /*!
380 \fn void QAbstractAxis::titleBrushChanged(const QBrush& brush)
381 The brush of the axis title has changed to \a brush.
382 */
383
384 /*!
385 \fn void QAbstractAxis::titleFontChanged(const QFont& font)
386 The font of the axis title has changed to \a font.
387 */
388 /*!
389 \qmlsignal AbstractAxis::onTitleFontChanged(Font font)
390 The font of the axis title has changed to \a font.
391 */
392
393 /*!
270 \fn void QAbstractAxis::shadesVisibleChanged(bool)
394 \fn void QAbstractAxis::shadesVisibleChanged(bool)
271 Emitted if the visibility of the axis shades is changed to \a visible.
395 Emitted if the visibility of the axis shades is changed to \a visible.
272 */
396 */
273 /*!
397 /*!
274 \qmlsignal AbstractAxis::onShadesVisibleChanged(bool visible)
398 \qmlsignal AbstractAxis::onShadesVisibleChanged(bool visible)
275 Emitted if the visibility of the axis shades is changed to \a visible.
399 Emitted if the visibility of the axis shades is changed to \a visible.
276 */
400 */
277
401
278 /*!
402 /*!
279 \fn void QAbstractAxis::shadesColorChanged(QColor color)
403 \fn void QAbstractAxis::shadesColorChanged(QColor color)
280 Emitted if the \a color of the axis shades is changed.
404 Emitted if the \a color of the axis shades is changed.
281 */
405 */
282 /*!
406 /*!
283 \qmlsignal AbstractAxis::onShadesColorChanged(QColor color)
407 \qmlsignal AbstractAxis::onShadesColorChanged(QColor color)
284 Emitted if the \a color of the axis shades is changed.
408 Emitted if the \a color of the axis shades is changed.
285 */
409 */
286
410
287 /*!
411 /*!
288 \fn void QAbstractAxis::shadesBorderColorChanged(QColor)
412 \fn void QAbstractAxis::shadesBorderColorChanged(QColor)
289 Emitted if the border \a color of the axis shades is changed.
413 Emitted if the border \a color of the axis shades is changed.
290 */
414 */
291 /*!
415 /*!
292 \qmlsignal AbstractAxis::onBorderColorChanged(QColor color)
416 \qmlsignal AbstractAxis::onBorderColorChanged(QColor color)
293 Emitted if the border \a color of the axis shades is changed.
417 Emitted if the border \a color of the axis shades is changed.
294 */
418 */
295
419
296 /*!
420 /*!
421 \fn void QAbstractAxis::shadesBrushChanged(const QBrush& brush)
422 The brush of the axis shades has changed to \a brush.
423 */
424
425 /*!
426 \fn void QAbstractAxis::shadesPenChanged(const QPen& pen)
427 The pen of the axis shades has changed to \a pen.
428 */
429
430 /*!
297 \internal
431 \internal
298 Constructs new axis object which is a child of \a parent. Ownership is taken by
432 Constructs new axis object which is a child of \a parent. Ownership is taken by
299 QChart when axis added.
433 QChart when axis added.
300 */
434 */
301
435
302 QAbstractAxis::QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent)
436 QAbstractAxis::QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent)
303 : QObject(parent),
437 : QObject(parent),
304 d_ptr(&d)
438 d_ptr(&d)
305 {
439 {
306 }
440 }
307
441
308 /*!
442 /*!
309 Destructor of the axis object. When axis is added to chart, chart object takes ownership.
443 Destructor of the axis object. When axis is added to chart, chart object takes ownership.
310 */
444 */
311
445
312 QAbstractAxis::~QAbstractAxis()
446 QAbstractAxis::~QAbstractAxis()
313 {
447 {
314 if (d_ptr->m_chart)
448 if (d_ptr->m_chart)
315 qFatal("Still binded axis detected !");
449 qFatal("Still binded axis detected !");
316 }
450 }
317
451
318 /*!
452 /*!
319 Sets \a pen used to draw axis line and ticks.
453 Sets \a pen used to draw axis line and ticks.
320 */
454 */
321 void QAbstractAxis::setLinePen(const QPen &pen)
455 void QAbstractAxis::setLinePen(const QPen &pen)
322 {
456 {
323 if (d_ptr->m_axisPen != pen) {
457 if (d_ptr->m_axisPen != pen) {
324 d_ptr->m_axisPen = pen;
458 d_ptr->m_axisPen = pen;
325 emit linePenChanged(pen);
459 emit linePenChanged(pen);
326 }
460 }
327 }
461 }
328
462
329 /*!
463 /*!
330 Returns pen used to draw axis and ticks.
464 Returns pen used to draw axis and ticks.
331 */
465 */
332 QPen QAbstractAxis::linePen() const
466 QPen QAbstractAxis::linePen() const
333 {
467 {
334 return d_ptr->m_axisPen;
468 return d_ptr->m_axisPen;
335 }
469 }
336
470
337 //TODO: remove me
471 //TODO: remove me
338 void QAbstractAxis::setLinePenColor(QColor color)
472 void QAbstractAxis::setLinePenColor(QColor color)
339 {
473 {
340 QPen p = d_ptr->m_axisPen;
474 QPen p = d_ptr->m_axisPen;
341 if (p.color() != color) {
475 if (p.color() != color) {
342 p.setColor(color);
476 p.setColor(color);
343 setLinePen(p);
477 setLinePen(p);
344 emit colorChanged(color);
478 emit colorChanged(color);
345 }
479 }
346 }
480 }
347
481
348 QColor QAbstractAxis::linePenColor() const
482 QColor QAbstractAxis::linePenColor() const
349 {
483 {
350 return d_ptr->m_axisPen.color();
484 return d_ptr->m_axisPen.color();
351 }
485 }
352
486
353 /*!
487 /*!
354 Sets if axis and ticks are \a visible.
488 Sets if axis and ticks are \a visible.
355 */
489 */
356 void QAbstractAxis::setLineVisible(bool visible)
490 void QAbstractAxis::setLineVisible(bool visible)
357 {
491 {
358 if (d_ptr->m_arrowVisible != visible) {
492 if (d_ptr->m_arrowVisible != visible) {
359 d_ptr->m_arrowVisible = visible;
493 d_ptr->m_arrowVisible = visible;
360 emit lineVisibleChanged(visible);
494 emit lineVisibleChanged(visible);
361 }
495 }
362 }
496 }
363
497
364 bool QAbstractAxis::isLineVisible() const
498 bool QAbstractAxis::isLineVisible() const
365 {
499 {
366 return d_ptr->m_arrowVisible;
500 return d_ptr->m_arrowVisible;
367 }
501 }
368
502
369 void QAbstractAxis::setGridLineVisible(bool visible)
503 void QAbstractAxis::setGridLineVisible(bool visible)
370 {
504 {
371 if (d_ptr->m_gridLineVisible != visible) {
505 if (d_ptr->m_gridLineVisible != visible) {
372 d_ptr->m_gridLineVisible = visible;
506 d_ptr->m_gridLineVisible = visible;
373 emit gridVisibleChanged(visible);
507 emit gridVisibleChanged(visible);
374 }
508 }
375 }
509 }
376
510
377 bool QAbstractAxis::isGridLineVisible() const
511 bool QAbstractAxis::isGridLineVisible() const
378 {
512 {
379 return d_ptr->m_gridLineVisible;
513 return d_ptr->m_gridLineVisible;
380 }
514 }
381
515
382 /*!
516 /*!
383 Sets \a pen used to draw grid line.
517 Sets \a pen used to draw grid line.
384 */
518 */
385 void QAbstractAxis::setGridLinePen(const QPen &pen)
519 void QAbstractAxis::setGridLinePen(const QPen &pen)
386 {
520 {
387 if (d_ptr->m_gridLinePen != pen) {
521 if (d_ptr->m_gridLinePen != pen) {
388 d_ptr->m_gridLinePen = pen;
522 d_ptr->m_gridLinePen = pen;
389 emit gridLinePenChanged(pen);
523 emit gridLinePenChanged(pen);
390 }
524 }
391 }
525 }
392
526
393 /*!
527 /*!
394 Returns pen used to draw grid.
528 Returns pen used to draw grid.
395 */
529 */
396 QPen QAbstractAxis::gridLinePen() const
530 QPen QAbstractAxis::gridLinePen() const
397 {
531 {
398 return d_ptr->m_gridLinePen;
532 return d_ptr->m_gridLinePen;
399 }
533 }
400
534
401 void QAbstractAxis::setLabelsVisible(bool visible)
535 void QAbstractAxis::setLabelsVisible(bool visible)
402 {
536 {
403 if (d_ptr->m_labelsVisible != visible) {
537 if (d_ptr->m_labelsVisible != visible) {
404 d_ptr->m_labelsVisible = visible;
538 d_ptr->m_labelsVisible = visible;
405 emit labelsVisibleChanged(visible);
539 emit labelsVisibleChanged(visible);
406 }
540 }
407 }
541 }
408
542
409 bool QAbstractAxis::labelsVisible() const
543 bool QAbstractAxis::labelsVisible() const
410 {
544 {
411 return d_ptr->m_labelsVisible;
545 return d_ptr->m_labelsVisible;
412 }
546 }
413
547
414 /*!
548 /*!
415 Sets \a pen used to draw labels.
549 Sets \a pen used to draw labels.
416 */
550 */
417 void QAbstractAxis::setLabelsPen(const QPen &pen)
551 void QAbstractAxis::setLabelsPen(const QPen &pen)
418 {
552 {
419 if (d_ptr->m_labelsPen != pen) {
553 if (d_ptr->m_labelsPen != pen) {
420 d_ptr->m_labelsPen = pen;
554 d_ptr->m_labelsPen = pen;
421 emit labelsPenChanged(pen);
555 emit labelsPenChanged(pen);
422 }
556 }
423 }
557 }
424
558
425 /*!
559 /*!
426 Returns the pen used to labels.
560 Returns the pen used to labels.
427 */
561 */
428 QPen QAbstractAxis::labelsPen() const
562 QPen QAbstractAxis::labelsPen() const
429 {
563 {
430 return d_ptr->m_labelsPen;
564 return d_ptr->m_labelsPen;
431 }
565 }
432
566
433 /*!
567 /*!
434 Sets \a brush used to draw labels.
568 Sets \a brush used to draw labels.
435 */
569 */
436 void QAbstractAxis::setLabelsBrush(const QBrush &brush)
570 void QAbstractAxis::setLabelsBrush(const QBrush &brush)
437 {
571 {
438 if (d_ptr->m_labelsBrush != brush) {
572 if (d_ptr->m_labelsBrush != brush) {
439 d_ptr->m_labelsBrush = brush;
573 d_ptr->m_labelsBrush = brush;
440 emit labelsBrushChanged(brush);
574 emit labelsBrushChanged(brush);
441 }
575 }
442 }
576 }
443
577
444 /*!
578 /*!
445 Returns brush used to draw labels.
579 Returns brush used to draw labels.
446 */
580 */
447 QBrush QAbstractAxis::labelsBrush() const
581 QBrush QAbstractAxis::labelsBrush() const
448 {
582 {
449 return d_ptr->m_labelsBrush;
583 return d_ptr->m_labelsBrush;
450 }
584 }
451
585
452 /*!
586 /*!
453 Sets \a font used to draw labels.
587 Sets \a font used to draw labels.
454 */
588 */
455 void QAbstractAxis::setLabelsFont(const QFont &font)
589 void QAbstractAxis::setLabelsFont(const QFont &font)
456 {
590 {
457 if (d_ptr->m_labelsFont != font) {
591 if (d_ptr->m_labelsFont != font) {
458 d_ptr->m_labelsFont = font;
592 d_ptr->m_labelsFont = font;
459 emit labelsFontChanged(font);
593 emit labelsFontChanged(font);
460 }
594 }
461 }
595 }
462
596
463 /*!
597 /*!
464 Returns font used to draw labels.
598 Returns font used to draw labels.
465 */
599 */
466 QFont QAbstractAxis::labelsFont() const
600 QFont QAbstractAxis::labelsFont() const
467 {
601 {
468 return d_ptr->m_labelsFont;
602 return d_ptr->m_labelsFont;
469 }
603 }
470
604
471 void QAbstractAxis::setLabelsAngle(int angle)
605 void QAbstractAxis::setLabelsAngle(int angle)
472 {
606 {
473 if (d_ptr->m_labelsAngle != angle) {
607 if (d_ptr->m_labelsAngle != angle) {
474 d_ptr->m_labelsAngle = angle;
608 d_ptr->m_labelsAngle = angle;
475 emit labelsAngleChanged(angle);
609 emit labelsAngleChanged(angle);
476 }
610 }
477 }
611 }
478
612
479 int QAbstractAxis::labelsAngle() const
613 int QAbstractAxis::labelsAngle() const
480 {
614 {
481 return d_ptr->m_labelsAngle;
615 return d_ptr->m_labelsAngle;
482 }
616 }
483 //TODO: remove me
617 //TODO: remove me
484 void QAbstractAxis::setLabelsColor(QColor color)
618 void QAbstractAxis::setLabelsColor(QColor color)
485 {
619 {
486 QBrush b = d_ptr->m_labelsBrush;
620 QBrush b = d_ptr->m_labelsBrush;
487 if (b.color() != color) {
621 if (b.color() != color) {
488 b.setColor(color);
622 b.setColor(color);
489 setLabelsBrush(b);
623 setLabelsBrush(b);
490 emit labelsColorChanged(color);
624 emit labelsColorChanged(color);
491 }
625 }
492 }
626 }
493
627
494 QColor QAbstractAxis::labelsColor() const
628 QColor QAbstractAxis::labelsColor() const
495 {
629 {
496 return d_ptr->m_labelsBrush.color();
630 return d_ptr->m_labelsBrush.color();
497 }
631 }
498
632
499 void QAbstractAxis::setTitleVisible(bool visible)
633 void QAbstractAxis::setTitleVisible(bool visible)
500 {
634 {
501 if (d_ptr->m_titleVisible != visible) {
635 if (d_ptr->m_titleVisible != visible) {
502 d_ptr->m_titleVisible = visible;
636 d_ptr->m_titleVisible = visible;
503 emit titleVisibleChanged(visible);
637 emit titleVisibleChanged(visible);
504 }
638 }
505 }
639 }
506
640
507 bool QAbstractAxis::isTitleVisible() const
641 bool QAbstractAxis::isTitleVisible() const
508 {
642 {
509 return d_ptr->m_titleVisible;
643 return d_ptr->m_titleVisible;
510 }
644 }
511
645
512 /*!
646 /*!
513 Sets \a pen used to draw title.
647 Sets \a pen used to draw title.
514 */
648 */
515 void QAbstractAxis::setTitlePen(const QPen &pen)
649 void QAbstractAxis::setTitlePen(const QPen &pen)
516 {
650 {
517 if (d_ptr->m_titlePen != pen) {
651 if (d_ptr->m_titlePen != pen) {
518 d_ptr->m_titlePen = pen;
652 d_ptr->m_titlePen = pen;
519 emit titlePenChanged(pen);
653 emit titlePenChanged(pen);
520 }
654 }
521 }
655 }
522
656
523 /*!
657 /*!
524 Returns the pen used to title.
658 Returns the pen used to title.
525 */
659 */
526 QPen QAbstractAxis::titlePen() const
660 QPen QAbstractAxis::titlePen() const
527 {
661 {
528 return d_ptr->m_titlePen;
662 return d_ptr->m_titlePen;
529 }
663 }
530
664
531 /*!
665 /*!
532 Sets \a brush used to draw title.
666 Sets \a brush used to draw title.
533 */
667 */
534 void QAbstractAxis::setTitleBrush(const QBrush &brush)
668 void QAbstractAxis::setTitleBrush(const QBrush &brush)
535 {
669 {
536 if (d_ptr->m_titleBrush != brush) {
670 if (d_ptr->m_titleBrush != brush) {
537 d_ptr->m_titleBrush = brush;
671 d_ptr->m_titleBrush = brush;
538 emit titleBrushChanged(brush);
672 emit titleBrushChanged(brush);
539 }
673 }
540 }
674 }
541
675
542 /*!
676 /*!
543 Returns brush used to draw title.
677 Returns brush used to draw title.
544 */
678 */
545 QBrush QAbstractAxis::titleBrush() const
679 QBrush QAbstractAxis::titleBrush() const
546 {
680 {
547 return d_ptr->m_titleBrush;
681 return d_ptr->m_titleBrush;
548 }
682 }
549
683
550 /*!
684 /*!
551 Sets \a font used to draw title.
685 Sets \a font used to draw title.
552 */
686 */
553 void QAbstractAxis::setTitleFont(const QFont &font)
687 void QAbstractAxis::setTitleFont(const QFont &font)
554 {
688 {
555 if (d_ptr->m_titleFont != font) {
689 if (d_ptr->m_titleFont != font) {
556 d_ptr->m_titleFont = font;
690 d_ptr->m_titleFont = font;
557 emit titleFontChanged(font);
691 emit titleFontChanged(font);
558 }
692 }
559 }
693 }
560
694
561 /*!
695 /*!
562 Returns font used to draw title.
696 Returns font used to draw title.
563 */
697 */
564 QFont QAbstractAxis::titleFont() const
698 QFont QAbstractAxis::titleFont() const
565 {
699 {
566 return d_ptr->m_titleFont;
700 return d_ptr->m_titleFont;
567 }
701 }
568
702
569 void QAbstractAxis::setTitleText(const QString &title)
703 void QAbstractAxis::setTitleText(const QString &title)
570 {
704 {
571 if (d_ptr->m_title != title) {
705 if (d_ptr->m_title != title) {
572 d_ptr->m_title = title;
706 d_ptr->m_title = title;
573 emit titleTextChanged(title);
707 emit titleTextChanged(title);
574 }
708 }
575 }
709 }
576
710
577 QString QAbstractAxis::titleText() const
711 QString QAbstractAxis::titleText() const
578 {
712 {
579 return d_ptr->m_title;
713 return d_ptr->m_title;
580 }
714 }
581
715
582
716
583 void QAbstractAxis::setShadesVisible(bool visible)
717 void QAbstractAxis::setShadesVisible(bool visible)
584 {
718 {
585 if (d_ptr->m_shadesVisible != visible) {
719 if (d_ptr->m_shadesVisible != visible) {
586 d_ptr->m_shadesVisible = visible;
720 d_ptr->m_shadesVisible = visible;
587 emit shadesVisibleChanged(visible);
721 emit shadesVisibleChanged(visible);
588 }
722 }
589 }
723 }
590
724
591 bool QAbstractAxis::shadesVisible() const
725 bool QAbstractAxis::shadesVisible() const
592 {
726 {
593 return d_ptr->m_shadesVisible;
727 return d_ptr->m_shadesVisible;
594 }
728 }
595
729
596 /*!
730 /*!
597 Sets \a pen used to draw shades.
731 Sets \a pen used to draw shades.
598 */
732 */
599 void QAbstractAxis::setShadesPen(const QPen &pen)
733 void QAbstractAxis::setShadesPen(const QPen &pen)
600 {
734 {
601 if (d_ptr->m_shadesPen != pen) {
735 if (d_ptr->m_shadesPen != pen) {
602 d_ptr->m_shadesPen = pen;
736 d_ptr->m_shadesPen = pen;
603 emit shadesPenChanged(pen);
737 emit shadesPenChanged(pen);
604 }
738 }
605 }
739 }
606
740
607 /*!
741 /*!
608 Returns pen used to draw shades.
742 Returns pen used to draw shades.
609 */
743 */
610 QPen QAbstractAxis::shadesPen() const
744 QPen QAbstractAxis::shadesPen() const
611 {
745 {
612 return d_ptr->m_shadesPen;
746 return d_ptr->m_shadesPen;
613 }
747 }
614
748
615 /*!
749 /*!
616 Sets \a brush used to draw shades.
750 Sets \a brush used to draw shades.
617 */
751 */
618 void QAbstractAxis::setShadesBrush(const QBrush &brush)
752 void QAbstractAxis::setShadesBrush(const QBrush &brush)
619 {
753 {
620 if (d_ptr->m_shadesBrush != brush) {
754 if (d_ptr->m_shadesBrush != brush) {
621 d_ptr->m_shadesBrush = brush;
755 d_ptr->m_shadesBrush = brush;
622 emit shadesBrushChanged(brush);
756 emit shadesBrushChanged(brush);
623 }
757 }
624 }
758 }
625
759
626 /*!
760 /*!
627 Returns brush used to draw shades.
761 Returns brush used to draw shades.
628 */
762 */
629 QBrush QAbstractAxis::shadesBrush() const
763 QBrush QAbstractAxis::shadesBrush() const
630 {
764 {
631 return d_ptr->m_shadesBrush;
765 return d_ptr->m_shadesBrush;
632 }
766 }
633
767
634 void QAbstractAxis::setShadesColor(QColor color)
768 void QAbstractAxis::setShadesColor(QColor color)
635 {
769 {
636 QBrush b = d_ptr->m_shadesBrush;
770 QBrush b = d_ptr->m_shadesBrush;
637 if (b.color() != color) {
771 if (b.color() != color) {
638 b.setColor(color);
772 b.setColor(color);
639 setShadesBrush(b);
773 setShadesBrush(b);
640 emit shadesColorChanged(color);
774 emit shadesColorChanged(color);
641 }
775 }
642 }
776 }
643
777
644 QColor QAbstractAxis::shadesColor() const
778 QColor QAbstractAxis::shadesColor() const
645 {
779 {
646 return d_ptr->m_shadesBrush.color();
780 return d_ptr->m_shadesBrush.color();
647 }
781 }
648
782
649 void QAbstractAxis::setShadesBorderColor(QColor color)
783 void QAbstractAxis::setShadesBorderColor(QColor color)
650 {
784 {
651 QPen p = d_ptr->m_shadesPen;
785 QPen p = d_ptr->m_shadesPen;
652 if (p.color() != color) {
786 if (p.color() != color) {
653 p.setColor(color);
787 p.setColor(color);
654 setShadesPen(p);
788 setShadesPen(p);
655 emit shadesColorChanged(color);
789 emit shadesColorChanged(color);
656 }
790 }
657 }
791 }
658
792
659 QColor QAbstractAxis::shadesBorderColor() const
793 QColor QAbstractAxis::shadesBorderColor() const
660 {
794 {
661 return d_ptr->m_shadesPen.color();
795 return d_ptr->m_shadesPen.color();
662 }
796 }
663
797
664
798
665 bool QAbstractAxis::isVisible() const
799 bool QAbstractAxis::isVisible() const
666 {
800 {
667 return d_ptr->m_visible;
801 return d_ptr->m_visible;
668 }
802 }
669
803
670 /*!
804 /*!
671 Sets axis, shades, labels and grid lines to be visible.
805 Sets axis, shades, labels and grid lines to be visible.
672 */
806 */
673 void QAbstractAxis::setVisible(bool visible)
807 void QAbstractAxis::setVisible(bool visible)
674 {
808 {
675 if (d_ptr->m_visible != visible) {
809 if (d_ptr->m_visible != visible) {
676 d_ptr->m_visible = visible;
810 d_ptr->m_visible = visible;
677 emit visibleChanged(visible);
811 emit visibleChanged(visible);
678 }
812 }
679 }
813 }
680
814
681
815
682 /*!
816 /*!
683 Sets axis, shades, labels and grid lines to be visible.
817 Sets axis, shades, labels and grid lines to be visible.
684 */
818 */
685 void QAbstractAxis::show()
819 void QAbstractAxis::show()
686 {
820 {
687 setVisible(true);
821 setVisible(true);
688 }
822 }
689
823
690 /*!
824 /*!
691 Sets axis, shades, labels and grid lines to not be visible.
825 Sets axis, shades, labels and grid lines to not be visible.
692 */
826 */
693 void QAbstractAxis::hide()
827 void QAbstractAxis::hide()
694 {
828 {
695 setVisible(false);
829 setVisible(false);
696 }
830 }
697
831
698 /*!
832 /*!
699 Sets the minimum value shown on the axis.
833 Sets the minimum value shown on the axis.
700 Depending on the actual axis type the \a min parameter is converted to appropriate type.
834 Depending on the actual axis type the \a min parameter is converted to appropriate type.
701 If the conversion is impossible then the function call does nothing
835 If the conversion is impossible then the function call does nothing
702 */
836 */
703 void QAbstractAxis::setMin(const QVariant &min)
837 void QAbstractAxis::setMin(const QVariant &min)
704 {
838 {
705 d_ptr->setMin(min);
839 d_ptr->setMin(min);
706 }
840 }
707
841
708 /*!
842 /*!
709 Sets the maximum value shown on the axis.
843 Sets the maximum value shown on the axis.
710 Depending on the actual axis type the \a max parameter is converted to appropriate type.
844 Depending on the actual axis type the \a max parameter is converted to appropriate type.
711 If the conversion is impossible then the function call does nothing
845 If the conversion is impossible then the function call does nothing
712 */
846 */
713 void QAbstractAxis::setMax(const QVariant &max)
847 void QAbstractAxis::setMax(const QVariant &max)
714 {
848 {
715 d_ptr->setMax(max);
849 d_ptr->setMax(max);
716 }
850 }
717
851
718 /*!
852 /*!
719 Sets the range shown on the axis.
853 Sets the range shown on the axis.
720 Depending on the actual axis type the \a min and \a max parameters are converted to appropriate types.
854 Depending on the actual axis type the \a min and \a max parameters are converted to appropriate types.
721 If the conversion is impossible then the function call does nothing.
855 If the conversion is impossible then the function call does nothing.
722 */
856 */
723 void QAbstractAxis::setRange(const QVariant &min, const QVariant &max)
857 void QAbstractAxis::setRange(const QVariant &min, const QVariant &max)
724 {
858 {
725 d_ptr->setRange(min, max);
859 d_ptr->setRange(min, max);
726 }
860 }
727
861
728
862
729 /*!
863 /*!
730 Returns the orientation in which the axis is being used (Vertical or Horizontal)
864 Returns the orientation in which the axis is being used (Vertical or Horizontal)
731 */
865 */
732 // NOTE: should have const but it breaks BC:
866 // NOTE: should have const but it breaks BC:
733 // http://techbase.kde.org/Policies/Binary_Compatibility_Examples#Change_the_CV-qualifiers_of_a_member_function
867 // http://techbase.kde.org/Policies/Binary_Compatibility_Examples#Change_the_CV-qualifiers_of_a_member_function
734 Qt::Orientation QAbstractAxis::orientation()
868 Qt::Orientation QAbstractAxis::orientation()
735 {
869 {
736 return d_ptr->orientation();
870 return d_ptr->orientation();
737 }
871 }
738
872
739 Qt::Alignment QAbstractAxis::alignment() const
873 Qt::Alignment QAbstractAxis::alignment() const
740 {
874 {
741 return d_ptr->alignment();
875 return d_ptr->alignment();
742 }
876 }
743
877
744 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
878 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
745
879
746 QAbstractAxisPrivate::QAbstractAxisPrivate(QAbstractAxis *q)
880 QAbstractAxisPrivate::QAbstractAxisPrivate(QAbstractAxis *q)
747 : q_ptr(q),
881 : q_ptr(q),
748 m_chart(0),
882 m_chart(0),
749 m_alignment(0),
883 m_alignment(0),
750 m_orientation(Qt::Orientation(0)),
884 m_orientation(Qt::Orientation(0)),
751 m_visible(true),
885 m_visible(true),
752 m_arrowVisible(true),
886 m_arrowVisible(true),
753 m_gridLineVisible(true),
887 m_gridLineVisible(true),
754 m_labelsVisible(true),
888 m_labelsVisible(true),
755 m_labelsAngle(0),
889 m_labelsAngle(0),
756 m_titleVisible(true),
890 m_titleVisible(true),
757 m_shadesVisible(false),
891 m_shadesVisible(false),
758 m_shadesBrush(Qt::SolidPattern),
892 m_shadesBrush(Qt::SolidPattern),
759 m_shadesOpacity(1.0),
893 m_shadesOpacity(1.0),
760 m_dirty(false)
894 m_dirty(false)
761 {
895 {
762
896
763 }
897 }
764
898
765 QAbstractAxisPrivate::~QAbstractAxisPrivate()
899 QAbstractAxisPrivate::~QAbstractAxisPrivate()
766 {
900 {
767 }
901 }
768
902
769 void QAbstractAxisPrivate::setAlignment( Qt::Alignment alignment)
903 void QAbstractAxisPrivate::setAlignment( Qt::Alignment alignment)
770 {
904 {
771 switch(alignment) {
905 switch(alignment) {
772 case Qt::AlignTop:
906 case Qt::AlignTop:
773 case Qt::AlignBottom:
907 case Qt::AlignBottom:
774 m_orientation = Qt::Horizontal;
908 m_orientation = Qt::Horizontal;
775 break;
909 break;
776 case Qt::AlignLeft:
910 case Qt::AlignLeft:
777 case Qt::AlignRight:
911 case Qt::AlignRight:
778 m_orientation = Qt::Vertical;
912 m_orientation = Qt::Vertical;
779 break;
913 break;
780 default:
914 default:
781 qWarning()<<"No alignment specified !";
915 qWarning()<<"No alignment specified !";
782 break;
916 break;
783 };
917 };
784 m_alignment=alignment;
918 m_alignment=alignment;
785 }
919 }
786
920
787 void QAbstractAxisPrivate::initializeTheme(ChartTheme* theme, bool forced)
921 void QAbstractAxisPrivate::initializeTheme(ChartTheme* theme, bool forced)
788 {
922 {
789 QPen pen;
923 QPen pen;
790 QBrush brush;
924 QBrush brush;
791 QFont font;
925 QFont font;
792
926
793 bool axisX = m_orientation == Qt::Horizontal;
927 bool axisX = m_orientation == Qt::Horizontal;
794
928
795 if (m_arrowVisible) {
929 if (m_arrowVisible) {
796
930
797 if (forced || brush == m_labelsBrush){
931 if (forced || brush == m_labelsBrush){
798 q_ptr->setLabelsBrush(theme->labelBrush());
932 q_ptr->setLabelsBrush(theme->labelBrush());
799 }
933 }
800 //TODO: introduce axis brush
934 //TODO: introduce axis brush
801 if (forced || brush == m_titleBrush){
935 if (forced || brush == m_titleBrush){
802 q_ptr->setTitleBrush(theme->labelBrush());
936 q_ptr->setTitleBrush(theme->labelBrush());
803 }
937 }
804 if (forced || pen == m_labelsPen){
938 if (forced || pen == m_labelsPen){
805 q_ptr->setLabelsPen(Qt::NoPen);// NoPen for performance reasons
939 q_ptr->setLabelsPen(Qt::NoPen);// NoPen for performance reasons
806 }
940 }
807 if (forced || pen == m_titlePen){
941 if (forced || pen == m_titlePen){
808 q_ptr->setTitlePen(Qt::NoPen);// Noen for performance reasons
942 q_ptr->setTitlePen(Qt::NoPen);// Noen for performance reasons
809 }
943 }
810 if (forced || m_shadesVisible) {
944 if (forced || m_shadesVisible) {
811
945
812 if (forced || brush == m_shadesBrush){
946 if (forced || brush == m_shadesBrush){
813 q_ptr->setShadesBrush(theme->backgroundShadesBrush());
947 q_ptr->setShadesBrush(theme->backgroundShadesBrush());
814 }
948 }
815 if (forced || pen == m_shadesPen){
949 if (forced || pen == m_shadesPen){
816 q_ptr->setShadesPen(theme->backgroundShadesPen());
950 q_ptr->setShadesPen(theme->backgroundShadesPen());
817 }
951 }
818 if (forced && (theme->backgroundShades() == ChartTheme::BackgroundShadesBoth
952 if (forced && (theme->backgroundShades() == ChartTheme::BackgroundShadesBoth
819 || (theme->backgroundShades() == ChartTheme::BackgroundShadesVertical && axisX)
953 || (theme->backgroundShades() == ChartTheme::BackgroundShadesVertical && axisX)
820 || (theme->backgroundShades() == ChartTheme::BackgroundShadesHorizontal && !axisX))) {
954 || (theme->backgroundShades() == ChartTheme::BackgroundShadesHorizontal && !axisX))) {
821 q_ptr->setShadesVisible(true);
955 q_ptr->setShadesVisible(true);
822 }
956 }
823 }
957 }
824
958
825 if (forced || pen == m_axisPen) {
959 if (forced || pen == m_axisPen) {
826 q_ptr->setLinePen(theme->axisLinePen());
960 q_ptr->setLinePen(theme->axisLinePen());
827 }
961 }
828
962
829 if (forced || pen == m_gridLinePen) {
963 if (forced || pen == m_gridLinePen) {
830 q_ptr->setGridLinePen(theme->girdLinePen());
964 q_ptr->setGridLinePen(theme->girdLinePen());
831 }
965 }
832
966
833 if (forced || font == m_labelsFont){
967 if (forced || font == m_labelsFont){
834 q_ptr->setLabelsFont(theme->labelFont());
968 q_ptr->setLabelsFont(theme->labelFont());
835 }
969 }
836 //TODO: discuss with Tero
970 //TODO: discuss with Tero
837 if (forced || font == m_titleFont){
971 if (forced || font == m_titleFont){
838 QFont font(m_labelsFont);
972 QFont font(m_labelsFont);
839 font.setBold(true);
973 font.setBold(true);
840 q_ptr->setTitleFont(font);
974 q_ptr->setTitleFont(font);
841 }
975 }
842 }
976 }
843 }
977 }
844
978
845 void QAbstractAxisPrivate::handleRangeChanged(qreal min, qreal max)
979 void QAbstractAxisPrivate::handleRangeChanged(qreal min, qreal max)
846 {
980 {
847 setRange(min,max);
981 setRange(min,max);
848 }
982 }
849
983
850 void QAbstractAxisPrivate::initializeGraphics(QGraphicsItem* parent)
984 void QAbstractAxisPrivate::initializeGraphics(QGraphicsItem* parent)
851 {
985 {
852 Q_UNUSED(parent);
986 Q_UNUSED(parent);
853 }
987 }
854
988
855 void QAbstractAxisPrivate::initializeAnimations(QChart::AnimationOptions options)
989 void QAbstractAxisPrivate::initializeAnimations(QChart::AnimationOptions options)
856 {
990 {
857 ChartAxis* axis = m_item.data();
991 ChartAxis* axis = m_item.data();
858 Q_ASSERT(axis);
992 Q_ASSERT(axis);
859 if(options.testFlag(QChart::GridAxisAnimations)) {
993 if(options.testFlag(QChart::GridAxisAnimations)) {
860 axis->setAnimation(new AxisAnimation(axis));
994 axis->setAnimation(new AxisAnimation(axis));
861 }else{
995 }else{
862 axis->setAnimation(0);
996 axis->setAnimation(0);
863 }
997 }
864 }
998 }
865
999
866
1000
867
1001
868 #include "moc_qabstractaxis.cpp"
1002 #include "moc_qabstractaxis.cpp"
869 #include "moc_qabstractaxis_p.cpp"
1003 #include "moc_qabstractaxis_p.cpp"
870
1004
871 QTCOMMERCIALCHART_END_NAMESPACE
1005 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,197 +1,194
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #ifndef QABSTRACTAXIS_H
21 #ifndef QABSTRACTAXIS_H
22 #define QABSTRACTAXIS_H
22 #define QABSTRACTAXIS_H
23
23
24 #include <qchartglobal.h>
24 #include <qchartglobal.h>
25 #include <QPen>
25 #include <QPen>
26 #include <QFont>
26 #include <QFont>
27 #include <QVariant>
27 #include <QVariant>
28
28
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30
30
31 class QAbstractAxisPrivate;
31 class QAbstractAxisPrivate;
32
32
33 class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject
33 class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 //visibility
36 //visibility
37 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
37 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
38 //arrow
38 //arrow
39 Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
39 Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
40 Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged)
40 Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged)
41 //TODO: make wrapping of color for qml
42 Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged)
41 Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged)
43 //labels
42 //labels
44 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
43 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
45 Q_PROPERTY(QPen lablesPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged)
44 Q_PROPERTY(QPen labelsPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged)
46 Q_PROPERTY(QBrush lablesBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged)
45 Q_PROPERTY(QBrush labelsBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged)
47 //TODO: fix labels angles to work with layout
46 //TODO: fix labels angles to work with layout
48 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
47 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged)
49 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged)
48 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged)
50 //TODO: make wrapping of color for qml
51 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
49 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
52 //grid
50 //grid
53 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
51 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
54 Q_PROPERTY(QPen girdLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged)
52 Q_PROPERTY(QPen gridLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged)
55 //shades
53 //shades
56 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
54 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
57 //TODO: make wrapping of color for qml
58 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
55 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
59 //TODO: make wrapping of border for qml
56 //TODO: make wrapping of border for qml
60 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
57 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
61 Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged)
58 Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged)
62 Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged)
59 Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged)
63 //title
60 //title
64 Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged)
61 Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged)
65 Q_PROPERTY(QPen titlePen READ titlePen WRITE setTitlePen NOTIFY titlePenChanged)
62 Q_PROPERTY(QPen titlePen READ titlePen WRITE setTitlePen NOTIFY titlePenChanged)
66 Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged)
63 Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged)
67 Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged)
64 Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged)
68 Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged)
65 Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged)
69 //orientation
66 //orientation
70 Q_PROPERTY(Qt::Orientation orientation READ orientation)
67 Q_PROPERTY(Qt::Orientation orientation READ orientation)
71 //aligment
68 //aligment
72 Q_PROPERTY(Qt::Alignment alignment READ alignment)
69 Q_PROPERTY(Qt::Alignment alignment READ alignment)
73
70
74 public:
71 public:
75
72
76 enum AxisType {
73 enum AxisType {
77 AxisTypeNoAxis = 0x0,
74 AxisTypeNoAxis = 0x0,
78 AxisTypeValue = 0x1,
75 AxisTypeValue = 0x1,
79 AxisTypeBarCategory = 0x2,
76 AxisTypeBarCategory = 0x2,
80 AxisTypeCategory = 0x3,
77 AxisTypeCategory = 0x3,
81 AxisTypeDateTime = 0x4,
78 AxisTypeDateTime = 0x4,
82 AxisTypeLogValue = 0x5
79 AxisTypeLogValue = 0x5
83 };
80 };
84
81
85 Q_DECLARE_FLAGS(AxisTypes, AxisType)
82 Q_DECLARE_FLAGS(AxisTypes, AxisType)
86
83
87 protected:
84 protected:
88 explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = 0);
85 explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = 0);
89
86
90 public:
87 public:
91 ~QAbstractAxis();
88 ~QAbstractAxis();
92
89
93 virtual AxisType type() const = 0;
90 virtual AxisType type() const = 0;
94
91
95 //visibility handling
92 //visibility handling
96 bool isVisible() const;
93 bool isVisible() const;
97 void setVisible(bool visible = true);
94 void setVisible(bool visible = true);
98 void show();
95 void show();
99 void hide();
96 void hide();
100
97
101 //arrow handling
98 //arrow handling
102 bool isLineVisible() const;
99 bool isLineVisible() const;
103 void setLineVisible(bool visible = true);
100 void setLineVisible(bool visible = true);
104 void setLinePen(const QPen &pen);
101 void setLinePen(const QPen &pen);
105 QPen linePen() const;
102 QPen linePen() const;
106 void setLinePenColor(QColor color);
103 void setLinePenColor(QColor color);
107 QColor linePenColor() const;
104 QColor linePenColor() const;
108
105
109 //grid handling
106 //grid handling
110 bool isGridLineVisible() const;
107 bool isGridLineVisible() const;
111 void setGridLineVisible(bool visible = true);
108 void setGridLineVisible(bool visible = true);
112 void setGridLinePen(const QPen &pen);
109 void setGridLinePen(const QPen &pen);
113 QPen gridLinePen() const;
110 QPen gridLinePen() const;
114
111
115 //labels handling
112 //labels handling
116 bool labelsVisible() const;
113 bool labelsVisible() const;
117 void setLabelsVisible(bool visible = true);
114 void setLabelsVisible(bool visible = true);
118 void setLabelsPen(const QPen &pen);
115 void setLabelsPen(const QPen &pen);
119 QPen labelsPen() const;
116 QPen labelsPen() const;
120 void setLabelsBrush(const QBrush &brush);
117 void setLabelsBrush(const QBrush &brush);
121 QBrush labelsBrush() const;
118 QBrush labelsBrush() const;
122 void setLabelsFont(const QFont &font);
119 void setLabelsFont(const QFont &font);
123 QFont labelsFont() const;
120 QFont labelsFont() const;
124 void setLabelsAngle(int angle);
121 void setLabelsAngle(int angle);
125 int labelsAngle() const;
122 int labelsAngle() const;
126 void setLabelsColor(QColor color);
123 void setLabelsColor(QColor color);
127 QColor labelsColor() const;
124 QColor labelsColor() const;
128
125
129 //title handling
126 //title handling
130 bool isTitleVisible() const;
127 bool isTitleVisible() const;
131 void setTitleVisible(bool visible = true);
128 void setTitleVisible(bool visible = true);
132 void setTitlePen(const QPen &pen);
129 void setTitlePen(const QPen &pen);
133 QPen titlePen() const;
130 QPen titlePen() const;
134 void setTitleBrush(const QBrush &brush);
131 void setTitleBrush(const QBrush &brush);
135 QBrush titleBrush() const;
132 QBrush titleBrush() const;
136 void setTitleFont(const QFont &font);
133 void setTitleFont(const QFont &font);
137 QFont titleFont() const;
134 QFont titleFont() const;
138 void setTitleText(const QString &title);
135 void setTitleText(const QString &title);
139 QString titleText() const;
136 QString titleText() const;
140
137
141 //shades handling
138 //shades handling
142 bool shadesVisible() const;
139 bool shadesVisible() const;
143 void setShadesVisible(bool visible = true);
140 void setShadesVisible(bool visible = true);
144 void setShadesPen(const QPen &pen);
141 void setShadesPen(const QPen &pen);
145 QPen shadesPen() const;
142 QPen shadesPen() const;
146 void setShadesBrush(const QBrush &brush);
143 void setShadesBrush(const QBrush &brush);
147 QBrush shadesBrush() const;
144 QBrush shadesBrush() const;
148 void setShadesColor(QColor color);
145 void setShadesColor(QColor color);
149 QColor shadesColor() const;
146 QColor shadesColor() const;
150 void setShadesBorderColor(QColor color);
147 void setShadesBorderColor(QColor color);
151 QColor shadesBorderColor() const;
148 QColor shadesBorderColor() const;
152
149
153 Qt::Orientation orientation(); //TODO: missing const <- BC
150 Qt::Orientation orientation(); //TODO: missing const <- BC
154 Qt::Alignment alignment() const;
151 Qt::Alignment alignment() const;
155
152
156 //range handling
153 //range handling
157 void setMin(const QVariant &min);
154 void setMin(const QVariant &min);
158 void setMax(const QVariant &max);
155 void setMax(const QVariant &max);
159 void setRange(const QVariant &min, const QVariant &max);
156 void setRange(const QVariant &min, const QVariant &max);
160
157
161 Q_SIGNALS:
158 Q_SIGNALS:
162 void visibleChanged(bool visible);
159 void visibleChanged(bool visible);
163 void linePenChanged(const QPen& pen);
160 void linePenChanged(const QPen& pen);
164 void lineVisibleChanged(bool visible);
161 void lineVisibleChanged(bool visible);
165 void labelsVisibleChanged(bool visible);
162 void labelsVisibleChanged(bool visible);
166 void labelsPenChanged(const QPen& pen);
163 void labelsPenChanged(const QPen& pen);
167 void labelsBrushChanged(const QBrush& brush);
164 void labelsBrushChanged(const QBrush& brush);
168 void labelsFontChanged(const QFont& pen);
165 void labelsFontChanged(const QFont& pen);
169 void labelsAngleChanged(int angle);
166 void labelsAngleChanged(int angle);
170 void gridLinePenChanged(const QPen& pen);
167 void gridLinePenChanged(const QPen& pen);
171 void gridVisibleChanged(bool visible);
168 void gridVisibleChanged(bool visible);
172 void colorChanged(QColor color);
169 void colorChanged(QColor color);
173 void labelsColorChanged(QColor color);
170 void labelsColorChanged(QColor color);
174 void titleTextChanged(const QString& title);
171 void titleTextChanged(const QString& title);
175 void titlePenChanged(const QPen& pen);
172 void titlePenChanged(const QPen& pen);
176 void titleBrushChanged(const QBrush brush);
173 void titleBrushChanged(const QBrush& brush);
177 void titleVisibleChanged(bool visible);
174 void titleVisibleChanged(bool visible);
178 void titleFontChanged(const QFont& font);
175 void titleFontChanged(const QFont& font);
179 void shadesVisibleChanged(bool visible);
176 void shadesVisibleChanged(bool visible);
180 void shadesColorChanged(QColor color);
177 void shadesColorChanged(QColor color);
181 void shadesBorderColorChanged(QColor color);
178 void shadesBorderColorChanged(QColor color);
182 void shadesPenChanged(const QPen& pen);
179 void shadesPenChanged(const QPen& pen);
183 void shadesBrushChanged(const QBrush brush);
180 void shadesBrushChanged(const QBrush& brush);
184
181
185 protected:
182 protected:
186 QScopedPointer<QAbstractAxisPrivate> d_ptr;
183 QScopedPointer<QAbstractAxisPrivate> d_ptr;
187 Q_DISABLE_COPY(QAbstractAxis)
184 Q_DISABLE_COPY(QAbstractAxis)
188 friend class ChartDataSet;
185 friend class ChartDataSet;
189 friend class ChartAxis;
186 friend class ChartAxis;
190 friend class ChartPresenter;
187 friend class ChartPresenter;
191 friend class ChartThemeManager;
188 friend class ChartThemeManager;
192 friend class AbstractDomain;
189 friend class AbstractDomain;
193 };
190 };
194
191
195 QTCOMMERCIALCHART_END_NAMESPACE
192 QTCOMMERCIALCHART_END_NAMESPACE
196
193
197 #endif // QABSTRACTAXIS_H
194 #endif // QABSTRACTAXIS_H
@@ -1,106 +1,131
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2012 Digia Plc
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 1.0
22
22
23 Row {
23 Row {
24 anchors.fill: parent
24 anchors.fill: parent
25 spacing: 5
25 spacing: 5
26 property variant axis
26 property variant axis
27
27
28 Flow {
28 Flow {
29 spacing: 5
29 spacing: 5
30 flow: Flow.TopToBottom
30 flow: Flow.TopToBottom
31 height: parent.height
31
32
32 Button {
33 Button {
33 text: "axis visible"
34 text: "axis visible"
34 onClicked: axis.visible = !axis.visible;
35 onClicked: axis.visible = !axis.visible;
35 }
36 }
36 Button {
37 Button {
37 text: "axis grid visible"
38 text: "axis line visible"
38 onClicked: axis.gridVisible = !axis.gridVisible;
39 onClicked: axis.lineVisible = !axis.lineVisible;
39 }
40 }
40 Button {
41 Button {
41 text: "axis color"
42 text: "axis color"
42 onClicked: axis.color = main.nextColor();
43 onClicked: axis.color = main.nextColor();
43 }
44 }
44 Button {
45 Button {
45 text: "axis labels color"
46 text: "axis labels visible"
46 onClicked: axis.labelsColor = main.nextColor();
47 onClicked: axis.labelsVisible = !axis.labelsVisible;
47 }
48 }
48 Button {
49 Button {
49 text: "axis labels angle +"
50 text: "axis labels angle +"
50 onClicked: axis.labelsAngle += 5;
51 onClicked: axis.labelsAngle += 5;
51 }
52 }
52 Button {
53 Button {
53 text: "axis labels angle -"
54 text: "axis labels angle -"
54 onClicked: axis.labelsAngle -= 5;
55 onClicked: axis.labelsAngle -= 5;
55 }
56 }
56 Button {
57 Button {
58 text: "axis labels color"
59 onClicked: axis.labelsColor = main.nextColor();
60 }
61 Button {
62 text: "axis grid visible"
63 onClicked: axis.gridVisible = !axis.gridVisible;
64 }
65 Button {
57 text: "axis shades visible"
66 text: "axis shades visible"
58 onClicked: axis.shadesVisible = !axis.shadesVisible;
67 onClicked: axis.shadesVisible = !axis.shadesVisible;
59 }
68 }
60 Button {
69 Button {
61 text: "axis shades color"
70 text: "axis shades color"
62 onClicked: axis.shadesColor = main.nextColor();
71 onClicked: axis.shadesColor = main.nextColor();
63 }
72 }
64 Button {
73 Button {
65 text: "axis shades bcolor"
74 text: "axis shades bcolor"
66 onClicked: axis.shadesBorderColor = main.nextColor();
75 onClicked: axis.shadesBorderColor = main.nextColor();
67 }
76 }
68 Button {
77 Button {
78 text: "axis title text"
79 onClicked: axis.titleText = axis.titleText + "X";
80 }
81 Button {
82 text: "axis title visible"
83 onClicked: axis.titleVisible = !axis.titleVisible;
84 }
85 Button {
69 text: "axis max +"
86 text: "axis max +"
70 onClicked: axis.max += 0.1;
87 onClicked: axis.max += 0.1;
71 }
88 }
72 Button {
89 Button {
73 text: "axis max -"
90 text: "axis max -"
74 onClicked: axis.max -= 0.1;
91 onClicked: axis.max -= 0.1;
75 }
92 }
76 Button {
93 Button {
77 text: "axis min +"
94 text: "axis min +"
78 onClicked: axis.min += 0.1;
95 onClicked: axis.min += 0.1;
79 }
96 }
80 Button {
97 Button {
81 text: "axis min -"
98 text: "axis min -"
82 onClicked: axis.min -= 0.1;
99 onClicked: axis.min -= 0.1;
83 }
100 }
84 Button {
101 Button {
85 text: "axis tick count +"
102 text: "axis tick count +"
86 onClicked: axis.tickCount++;
103 onClicked: axis.tickCount++;
87 }
104 }
88 Button {
105 Button {
89 text: "axis tick count -"
106 text: "axis tick count -"
90
107
91 onClicked: axis.tickCount--;
108 onClicked: axis.tickCount--;
92 }
109 }
93 Button {
110 Button {
94 text: "axis nice nmb"
111 text: "axis nice nmb"
95 onClicked: axis.niceNumbersEnabled = !axis.niceNumbersEnabled;
112 onClicked: axis.niceNumbersEnabled = !axis.niceNumbersEnabled;
96 }
113 }
97 }
98
114
99 FontEditor {
115 FontEditor {
100 id: fontEditor
116 id: fontEditor
101 fontDescription: "axis"
117 fontDescription: "axis"
102 function editedFont() {
118 function editedFont() {
103 return axis.labelsFont;
119 return axis.labelsFont;
120 }
121 }
122
123 FontEditor {
124 id: titleFontEditor
125 fontDescription: "title"
126 function editedFont() {
127 return axis.titleFont;
128 }
104 }
129 }
105 }
130 }
106 }
131 }
General Comments 0
You need to be logged in to leave comments. Login now