##// END OF EJS Templates
make setAxisX setAxisY functionality compatible
Michal Klocek -
r2278:c185a1f604d6
parent child
Show More
@@ -1,662 +1,654
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #include "qchart.h"
22 22 #include "qchart_p.h"
23 23 #include "legendscroller_p.h"
24 24 #include "qlegend_p.h"
25 25 #include "chartbackground_p.h"
26 26 #include "qabstractaxis.h"
27 27 #include "chartlayout_p.h"
28 28 #include "charttheme_p.h"
29 29 #include "chartpresenter_p.h"
30 30 #include "chartdataset_p.h"
31 31 #include <QGraphicsScene>
32 32 #include <QGraphicsSceneResizeEvent>
33 33
34 34 QTCOMMERCIALCHART_BEGIN_NAMESPACE
35 35
36 36 /*!
37 37 \enum QChart::ChartTheme
38 38
39 39 This enum describes the theme used by the chart.
40 40
41 41 \value ChartThemeLight The default theme
42 42 \value ChartThemeBlueCerulean
43 43 \value ChartThemeDark
44 44 \value ChartThemeBrownSand
45 45 \value ChartThemeBlueNcs
46 46 \value ChartThemeHighContrast
47 47 \value ChartThemeBlueIcy
48 48 */
49 49
50 50 /*!
51 51 \enum QChart::AnimationOption
52 52
53 53 For enabling/disabling animations. Defaults to NoAnimation.
54 54
55 55 \value NoAnimation
56 56 \value GridAxisAnimations
57 57 \value SeriesAnimations
58 58 \value AllAnimations
59 59 */
60 60
61 61 /*!
62 62 \class QChart
63 63 \brief QtCommercial chart API.
64 64
65 65 QChart is a QGraphicsWidget that you can show in a QGraphicsScene. It manages the graphical
66 66 representation of different types of series and other chart related objects like
67 67 QAxis and QLegend. If you simply want to show a chart in a layout, you can use the
68 68 convenience class QChartView instead of QChart.
69 69 \sa QChartView
70 70 */
71 71
72 72 /*!
73 73 \property QChart::animationOptions
74 74 The animation \a options for the chart. Animations are enabled/disabled based on this setting.
75 75 */
76 76
77 77 /*!
78 78 \property QChart::backgroundVisible
79 79 Whether the chart background is visible or not.
80 80 \sa setBackgroundBrush(), setBackgroundPen()
81 81 */
82 82
83 83 /*!
84 84 \property QChart::dropShadowEnabled
85 85 If set to true, the background drop shadow effect is enabled. If set to false, it is disabled. Note that the drop
86 86 shadow effect depends on theme, which means the setting may be changed if you switch to another theme.
87 87 */
88 88
89 89 /*!
90 90 \property QChart::minimumMargins
91 91 Minimum margins between the plot area (axes) and the edge of the chart widget.
92 92 */
93 93
94 94 /*!
95 95 \property QChart::theme
96 96 Theme is a built-in collection of UI style related settings applied for all visual elements of a chart, like colors,
97 97 pens, brushes and fonts of series, axes, title and legend. \l {Chart themes demo} shows an example with a few
98 98 different themes.
99 99 Note: changing the theme will overwrite all customizations previously applied to the series.
100 100 */
101 101
102 102 /*!
103 103 \property QChart::title
104 104 Title is the name (label) of a chart. It is shown as a headline on top of the chart.
105 105 */
106 106
107 107 /*!
108 108 Constructs a chart object which is a child of a\a parent. Parameter \a wFlags is passed to the QGraphicsWidget constructor.
109 109 */
110 110 QChart::QChart(QGraphicsItem *parent, Qt::WindowFlags wFlags)
111 111 : QGraphicsWidget(parent, wFlags),
112 112 d_ptr(new QChartPrivate(this))
113 113 {
114 114 d_ptr->m_legend = new LegendScroller(this);
115 115 setTheme(QChart::ChartThemeLight);
116 116 //TODO: what is that ?
117 117 //connect(d_ptr->m_presenter, SIGNAL(marginsChanged(QRectF)), this, SIGNAL(marginsChanged(QRectF)));
118 118 setLayout(d_ptr->m_presenter->layout());
119 119 }
120 120
121 121 /*!
122 122 Destroys the object and it's children, like series and axis objects added to it.
123 123 */
124 124 QChart::~QChart()
125 125 {
126 126 //start by deleting dataset, it will remove all series and axes
127 127 delete d_ptr->m_dataset;
128 128 d_ptr->m_dataset = 0;
129 129 }
130 130
131 131 /*!
132 132 Adds the \a series onto the chart and takes the ownership of the object.
133 133 If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and
134 134 the y axis).
135 135
136 136 \sa removeSeries(), removeAllSeries()
137 137 */
138 138 void QChart::addSeries(QAbstractSeries *series)
139 139 {
140 140 Q_ASSERT(series);
141 141 d_ptr->m_dataset->addSeries(series);
142 142 }
143 143
144 144 /*!
145 145 Removes the \a series specified in a perameter from the QChartView.
146 146 It releses its ownership of the specified QChartSeries object.
147 147 It does not delete the pointed QChartSeries data object
148 148 \sa addSeries(), removeAllSeries()
149 149 */
150 150 void QChart::removeSeries(QAbstractSeries *series)
151 151 {
152 152 Q_ASSERT(series);
153 153 d_ptr->m_dataset->removeSeries(series);
154 154 }
155 155
156 156 /*!
157 157 Removes all the QChartSeries that have been added to the QChartView
158 158 It also deletes the pointed QChartSeries data objects
159 159 \sa addSeries(), removeSeries()
160 160 */
161 161 void QChart::removeAllSeries()
162 162 {
163 163 d_ptr->m_dataset->removeAllSeries();
164 164 }
165 165
166 166 /*!
167 167 Sets the \a brush that is used for painting the background of the chart area.
168 168 */
169 169 void QChart::setBackgroundBrush(const QBrush &brush)
170 170 {
171 171 d_ptr->m_presenter->setBackgroundBrush(brush);
172 172 }
173 173
174 174 /*!
175 175 Gets the brush that is used for painting the background of the chart area.
176 176 */
177 177 QBrush QChart::backgroundBrush() const
178 178 {
179 179 return d_ptr->m_presenter->backgroundBrush();
180 180 }
181 181
182 182 /*!
183 183 Sets the \a pen that is used for painting the background of the chart area.
184 184 */
185 185 void QChart::setBackgroundPen(const QPen &pen)
186 186 {
187 187 d_ptr->m_presenter->setBackgroundPen(pen);
188 188 }
189 189
190 190 /*!
191 191 Gets the pen that is used for painting the background of the chart area.
192 192 */
193 193 QPen QChart::backgroundPen() const
194 194 {
195 195 return d_ptr->m_presenter->backgroundPen();
196 196 }
197 197
198 198 /*!
199 199 Sets the chart \a title. The description text that is drawn above the chart.
200 200 */
201 201 void QChart::setTitle(const QString &title)
202 202 {
203 203 d_ptr->m_presenter->setTitle(title);
204 204 }
205 205
206 206 /*!
207 207 Returns the chart title. The description text that is drawn above the chart.
208 208 */
209 209 QString QChart::title() const
210 210 {
211 211 return d_ptr->m_presenter->title();
212 212 }
213 213
214 214 /*!
215 215 Sets the \a font that is used for drawing the chart description text that is rendered above the chart.
216 216 */
217 217 void QChart::setTitleFont(const QFont &font)
218 218 {
219 219 d_ptr->m_presenter->setTitleFont(font);
220 220 }
221 221
222 222 /*!
223 223 Gets the font that is used for drawing the chart description text that is rendered above the chart.
224 224 */
225 225 QFont QChart::titleFont() const
226 226 {
227 227 return d_ptr->m_presenter->titleFont();
228 228 }
229 229
230 230 /*!
231 231 Sets the \a brush used for rendering the title text.
232 232 */
233 233 void QChart::setTitleBrush(const QBrush &brush)
234 234 {
235 235 d_ptr->m_presenter->setTitleBrush(brush);
236 236 }
237 237
238 238 /*!
239 239 Returns the brush used for rendering the title text.
240 240 */
241 241 QBrush QChart::titleBrush() const
242 242 {
243 243 return d_ptr->m_presenter->titleBrush();
244 244 }
245 245
246 246 void QChart::setTheme(QChart::ChartTheme theme)
247 247 {
248 248 d_ptr->m_themeManager->setTheme(theme);
249 249 }
250 250
251 251 QChart::ChartTheme QChart::theme() const
252 252 {
253 253 return d_ptr->m_themeManager->theme()->id();
254 254 }
255 255
256 256 /*!
257 257 Zooms in the view by a factor of 2
258 258 */
259 259 void QChart::zoomIn()
260 260 {
261 261 d_ptr->zoomIn(2.0);
262 262 }
263 263
264 264 /*!
265 265 Zooms in the view to a maximum level at which \a rect is still fully visible.
266 266 */
267 267 void QChart::zoomIn(const QRectF &rect)
268 268 {
269 269 d_ptr->zoomIn(rect);
270 270 }
271 271
272 272 /*!
273 273 Restores the view zoom level to the previous one.
274 274 */
275 275 void QChart::zoomOut()
276 276 {
277 277 d_ptr->zoomOut(2.0);
278 278 }
279 279
280 280 /*!
281 281 Zooms in the view by a \a factor.
282 282
283 283 A factor over 1.0 zooms the view in and factor between 0.0 and 1.0 zooms out.
284 284 */
285 285 void QChart::zoom(qreal factor)
286 286 {
287 287 if (qFuzzyCompare(factor, 0))
288 288 return;
289 289
290 290 if (qFuzzyCompare(factor, (qreal)1.0))
291 291 return;
292 292
293 293 if (factor < 0)
294 294 return;
295 295
296 296 if (factor > 1.0)
297 297 d_ptr->zoomIn(factor);
298 298 else
299 299 d_ptr->zoomOut(1.0 / factor);
300 300 }
301 301
302 302 /*!
303 303 Returns the pointer to the x axis object of the chart asociated with the specified \a series
304 304 If no series is provided then pointer to currently visible axis is provided
305 305 */
306 306 QAbstractAxis *QChart::axisX(QAbstractSeries *series) const
307 307 {
308 308 if(!series && d_ptr->m_dataset->series().size()>0){
309 309 series = d_ptr->m_dataset->series().first();
310 }else{
311 return 0;
312 310 }
313 311
314 312 QList<QAbstractAxis*> axes = series->attachedAxes();
315 313 QAbstractAxis* bottom=0;
316 314 QAbstractAxis* top=0;
317 315
318 316 foreach(QAbstractAxis* axis, axes){
319 317
320 318 if(axis->alignment()==Qt::AlignTop){
321 319 top=axis;
322 320 }
323 321
324 322 if(axis->alignment()==Qt::AlignBottom){
325 323 bottom=axis;
326 324 }
327 325 }
328 326 return bottom?bottom:top;
329 327 }
330 328
331 329 /*!
332 330 Returns the pointer to the y axis object of the chart asociated with the specified \a series
333 331 If no series is provided then pointer to currently visible axis is provided
334 332 */
335 333 QAbstractAxis *QChart::axisY(QAbstractSeries *series) const
336 334 {
337 335 if(!series && d_ptr->m_dataset->series().size()>0) {
338 336 series = d_ptr->m_dataset->series().first();
339 } else {
340 return 0;
341 337 }
342 338
343 339 QList<QAbstractAxis*> axes = series->attachedAxes();
344 340
345 341 QAbstractAxis* left=0;
346 342 QAbstractAxis* right=0;
347 343
348 344 foreach(QAbstractAxis* axis, axes){
349 345
350 346 if(axis->alignment()==Qt::AlignLeft){
351 347 left=axis;
352 348 }
353 349
354 350 if(axis->alignment()==Qt::AlignRight){
355 351 right=axis;
356 352 }
357 353 }
358 354
359 355 return left?left:right;
360 356 }
361 357
362 358
363 359 QList<QAbstractAxis *> QChart::axes(Qt::Orientations orientation, QAbstractSeries *series) const
364 360 {
365 361 QList<QAbstractAxis *> result ;
366 362
367 363 foreach(QAbstractAxis* axis,series->attachedAxes()){
368 364 if(orientation.testFlag(axis->orientation()))
369 365 result << axis;
370 366 }
371 367
372 368 return result;
373 369 }
374 370
375 371 /*!
376 372 NOTICE: This function has to be called after series has been added to the chart if no customized axes are set to the chart. Otherwise axisX(), axisY() calls return NULL.
377 373
378 374 Creates the axes for the chart based on the series that has already been added to the chart.
379 375
380 376 \table
381 377 \header
382 378 \o Series type
383 379 \o X-axis
384 380 \o Y-axis
385 381 \row
386 382 \o QXYSeries
387 383 \o QValueAxis
388 384 \o QValueAxis
389 385 \row
390 386 \o QBarSeries
391 387 \o QBarCategoryAxis
392 388 \o QValueAxis
393 389 \row
394 390 \o QPieSeries
395 391 \o None
396 392 \o None
397 393 \endtable
398 394
399 395 If there are several QXYSeries derived series added to the chart and no other series type has been added then only one pair of axes is created.
400 396 If there are sevaral series added of different types then each series gets its own axes pair.
401 397
402 398 NOTICE: if there is more than one x and y axes created then no axis is drawn by default and one needs to choose explicitly which axis should be shown.
403 399
404 400 Axis specifix to the series can be later obtained from the chart by providing the series as the parameter of axisX(), axisY() function calls.
405 401 QPieSeries does not create any axes.
406 402
407 403 \sa axisX(), axisY(), setAxisX(), setAxisY()
408 404 */
409 405 void QChart::createDefaultAxes()
410 406 {
411 407 d_ptr->m_dataset->createDefaultAxes();
412 408 }
413 409
414 410 /*!
415 411 Returns the legend object of the chart. Ownership stays in chart.
416 412 */
417 413 QLegend *QChart::legend() const
418 414 {
419 415 return d_ptr->m_legend;
420 416 }
421 417
422 418 /*!
423 419 Sets the minimum \a margins between the plot area (axes) and the edge of the chart widget.
424 420 Deprecated. Use setMargins().
425 421 */
426 422 void QChart::setMinimumMargins(const QMargins &margins)
427 423 {
428 424 qWarning() << "QChart::setMinimumMargins is deprecated. Use QChart::setMargins instead.";
429 425 d_ptr->m_presenter->layout()->setMargins(margins);
430 426 }
431 427
432 428 /*!
433 429 Returns the rect that contains information about margins (distance between chart widget edge and axes).
434 430 Individual margins can be obtained by calling left, top, right, bottom on the returned rect.
435 431 Deprecated. Use margins().
436 432 */
437 433 QMargins QChart::minimumMargins() const
438 434 {
439 435 qWarning() << "QChart::minimumMargins is deprecated. Use QChart::margins instead.";
440 436 return d_ptr->m_presenter->layout()->margins();
441 437 }
442 438
443 439 /*!
444 440 Sets the minimum \a margins between the plot area (axes) and the edge of the chart widget.
445 441 */
446 442 void QChart::setMargins(const QMargins &margins)
447 443 {
448 444 d_ptr->m_presenter->layout()->setMargins(margins);
449 445 }
450 446
451 447 /*!
452 448 Returns the rect that contains information about margins (distance between chart widget edge and axes).
453 449 Individual margins can be obtained by calling left, top, right, bottom on the returned rect.
454 450 */
455 451 QMargins QChart::margins() const
456 452 {
457 453 return d_ptr->m_presenter->layout()->margins();
458 454 }
459 455
460 456 /*!
461 457 Returns the the rect within which the drawing of the chart is done.
462 458 It does not include the area defines by margins.
463 459 */
464 460 QRectF QChart::plotArea() const
465 461 {
466 462 return d_ptr->m_presenter->geometry();
467 463 }
468 464
469 465 ///*!
470 466 // TODO: Dummy.
471 467 // Adjest the ranges of the axes so that all the data of the specified \a series is visible
472 468 // */
473 469 //void QChart::adjustViewToSeries(QAbstractSeries* series)
474 470 //{
475 471 // //
476 472 //}
477 473
478 474 /*!
479 475 Sets animation \a options for the chart
480 476 */
481 477 void QChart::setAnimationOptions(AnimationOptions options)
482 478 {
483 479 d_ptr->m_presenter->setAnimationOptions(options);
484 480 }
485 481
486 482 QChart::AnimationOptions QChart::animationOptions() const
487 483 {
488 484 return d_ptr->m_presenter->animationOptions();
489 485 }
490 486
491 487 /*!
492 488 Scrolls the visible area of the chart by the distance defined in the \a dx and \a dy.
493 489 */
494 490 void QChart::scroll(qreal dx, qreal dy)
495 491 {
496 492 d_ptr->scroll(dx,dy);
497 493 }
498 494
499 495 void QChart::setBackgroundVisible(bool visible)
500 496 {
501 497 d_ptr->m_presenter->setBackgroundVisible(visible);
502 498 }
503 499
504 500 bool QChart::isBackgroundVisible() const
505 501 {
506 502 return d_ptr->m_presenter->isBackgroundVisible();
507 503 }
508 504
509 505 void QChart::setDropShadowEnabled(bool enabled)
510 506 {
511 507 d_ptr->m_presenter->setBackgroundDropShadowEnabled(enabled);
512 508 }
513 509
514 510 bool QChart::isDropShadowEnabled() const
515 511 {
516 512 return d_ptr->m_presenter->isBackgroundDropShadowEnabled();
517 513 }
518 514
519 515 /*!
520 516 Returns all the series that are added to the chart.
521 517
522 518 \sa addSeries(), removeSeries(), removeAllSeries()
523 519 */
524 520 QList<QAbstractSeries *> QChart::series() const
525 521 {
526 522 return d_ptr->m_dataset->series();
527 523 }
528 524
529 525 /*!
530 526 Sets \a axis to the chart, which will control the presentation of the \a series
531 527
532 528 \sa axisX(), axisY(), setAxisY(), createDefaultAxes()
533 529 */
534 530 void QChart::setAxisX(QAbstractAxis *axis , QAbstractSeries *series)
535 531 {
536 532 QList<QAbstractAxis*> list = axes(Qt::Horizontal,series);
537 533
538 534 foreach(QAbstractAxis* a, list){
539 if(a->alignment()==axis->alignment()){
540 535 d_ptr->m_dataset->removeAxis(a);
541 536 delete a;
542 537 }
543 }
544 538
545 539 if(!d_ptr->m_dataset->axes().contains(axis))
546 540 d_ptr->m_dataset->addAxis(axis,Qt::AlignBottom);
547 541 d_ptr->m_dataset->attachAxis(series,axis);
548 542 }
549 543
550 544 /*!
551 545 Sets \a axis to the chart, which will control the presentation of the \a series
552 546
553 547 \sa axisX(), axisY(), setAxisX(), createDefaultAxes()
554 548 */
555 549 void QChart::setAxisY(QAbstractAxis *axis , QAbstractSeries *series)
556 550 {
557 551 QList<QAbstractAxis*> list = axes(Qt::Vertical,series);
558 552
559 553 foreach(QAbstractAxis* a, list) {
560 if(a->alignment()==axis->alignment()) {
561 554 d_ptr->m_dataset->removeAxis(a);
562 555 delete a;
563 556 }
564 }
565 557
566 558 if(!d_ptr->m_dataset->axes().contains(axis))
567 559 d_ptr->m_dataset->addAxis(axis,Qt::AlignLeft);
568 560 d_ptr->m_dataset->attachAxis(series,axis);
569 561 }
570 562
571 563 void QChart::addAxis(QAbstractAxis *axis,Qt::Alignment aligment)
572 564 {
573 565 d_ptr->m_dataset->addAxis(axis,aligment);
574 566 }
575 567
576 568 void QChart::removeAxis(QAbstractAxis *axis)
577 569 {
578 570 d_ptr->m_dataset->removeAxis(axis);
579 571 }
580 572
581 573 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
582 574
583 575 QChartPrivate::QChartPrivate(QChart *q):
584 576 q_ptr(q),
585 577 m_legend(0),
586 578 m_dataset(new ChartDataSet(q)),
587 579 m_presenter(new ChartPresenter(q)),
588 580 m_themeManager(new ChartThemeManager(q))
589 581 {
590 582 QObject::connect(m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), m_presenter, SLOT(handleSeriesAdded(QAbstractSeries*)));
591 583 QObject::connect(m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), m_presenter, SLOT(handleSeriesRemoved(QAbstractSeries*)));
592 584 QObject::connect(m_dataset, SIGNAL(axisAdded(QAbstractAxis*)), m_presenter, SLOT(handleAxisAdded(QAbstractAxis*)));
593 585 QObject::connect(m_dataset, SIGNAL(axisRemoved(QAbstractAxis*)), m_presenter, SLOT(handleAxisRemoved(QAbstractAxis*)));
594 586 QObject::connect(m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), m_themeManager, SLOT(handleSeriesAdded(QAbstractSeries*)));
595 587 QObject::connect(m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), m_themeManager, SLOT(handleSeriesRemoved(QAbstractSeries*)));
596 588 QObject::connect(m_dataset, SIGNAL(axisAdded(QAbstractAxis*)), m_themeManager, SLOT(handleAxisAdded(QAbstractAxis*)));
597 589 QObject::connect(m_dataset, SIGNAL(axisRemoved(QAbstractAxis*)), m_themeManager, SLOT(handleAxisRemoved(QAbstractAxis*)));
598 590 }
599 591
600 592 QChartPrivate::~QChartPrivate()
601 593 {
602 594
603 595 }
604 596
605 597 void QChartPrivate::zoomIn(qreal factor)
606 598 {
607 599 QRectF rect = m_presenter->geometry();
608 600 rect.setWidth(rect.width() / factor);
609 601 rect.setHeight(rect.height() / factor);
610 602 rect.moveCenter(m_presenter->geometry().center());
611 603 zoomIn(rect);
612 604 }
613 605
614 606 void QChartPrivate::zoomIn(const QRectF &rect)
615 607 {
616 608 if (!rect.isValid())
617 609 return;
618 610
619 611 QRectF r = rect.normalized();
620 612 const QRectF geometry = m_presenter->geometry();
621 613 r.translate(-geometry.topLeft());
622 614
623 615 if (!r.isValid())
624 616 return;
625 617
626 618 QPointF zoomPoint(r.center().x() / geometry.width(), r.center().y() / geometry.height());
627 619 m_presenter->setState(ChartPresenter::ZoomInState,zoomPoint);
628 620 m_dataset->zoomInDomain(r);
629 621 m_presenter->setState(ChartPresenter::ShowState,QPointF());
630 622
631 623 }
632 624
633 625 void QChartPrivate::zoomOut(qreal factor)
634 626 {
635 627 const QRectF geometry = m_presenter->geometry();
636 628
637 629 QRectF r;
638 630 r.setSize(geometry.size() / factor);
639 631 r.moveCenter(QPointF(geometry.size().width()/2 ,geometry.size().height()/2));
640 632 if (!r.isValid())
641 633 return;
642 634
643 635 QPointF zoomPoint(r.center().x() / geometry.width(), r.center().y() / geometry.height());
644 636 m_presenter->setState(ChartPresenter::ZoomOutState,zoomPoint);
645 637 m_dataset->zoomOutDomain(r);
646 638 m_presenter->setState(ChartPresenter::ShowState,QPointF());
647 639 }
648 640
649 641 void QChartPrivate::scroll(qreal dx, qreal dy)
650 642 {
651 643 if (dx < 0) m_presenter->setState(ChartPresenter::ScrollLeftState,QPointF());
652 644 if (dx > 0) m_presenter->setState(ChartPresenter::ScrollRightState,QPointF());
653 645 if (dy < 0) m_presenter->setState(ChartPresenter::ScrollUpState,QPointF());
654 646 if (dy > 0) m_presenter->setState(ChartPresenter::ScrollDownState,QPointF());
655 647
656 648 m_dataset->scrollDomain(dx, dy);
657 649 m_presenter->setState(ChartPresenter::ShowState,QPointF());
658 650 }
659 651
660 652 #include "moc_qchart.cpp"
661 653
662 654 QTCOMMERCIALCHART_END_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now