##// END OF EJS Templates
Fonts and background of the themes...
Fonts and background of the themes The theme demo app window color now matches the theme

File last commit:

r611:e622b3a8d8a0
r614:ac346143dd38
Show More
chartpresenter.cpp
401 lines | 13.5 KiB | text/x-c | CppLexer
/ src / chartpresenter.cpp
Michal Klocek
Refactored for MVP...
r139 #include "qchart.h"
Michal Klocek
Adds refactored axis to presenter
r140 #include "qchartaxis.h"
Michal Klocek
Refactors qchart , adds line animation...
r131 #include "chartpresenter_p.h"
#include "chartdataset_p.h"
Michal Klocek
Refactor themes...
r143 #include "charttheme_p.h"
Michal Klocek
Animation refactor...
r530 #include "chartanimator_p.h"
Michal Klocek
Refactored for MVP...
r139 //series
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 #include "qbarseries.h"
#include "qstackedbarseries.h"
#include "qpercentbarseries.h"
Michal Klocek
Rename QLineChartSeries to QLineSeries
r349 #include "qlineseries.h"
Michal Klocek
Adds area chart...
r421 #include "qareaseries.h"
Jani Honkonen
Pie chart refactoring
r142 #include "qpieseries.h"
Tero Ahola
Integrated scatter again. Missing functionality....
r158 #include "qscatterseries.h"
Marek Rosa
Spline initial
r295 #include "qsplineseries.h"
Michal Klocek
Refactored for MVP...
r139 //items
Michal Klocek
Adds refactored axis to presenter
r140 #include "axisitem_p.h"
Michal Klocek
Adds area chart...
r421 #include "areachartitem_p.h"
sauimone
added _p to private class headers
r381 #include "barpresenter_p.h"
#include "stackedbarpresenter_p.h"
#include "percentbarpresenter_p.h"
Michal Klocek
Fix previous broken commit
r145 #include "linechartitem_p.h"
Jani Honkonen
Rename piepresenter -> piechartitem
r568 #include "piechartitem_p.h"
Michal Klocek
Refactor scatter chart to fit the other classes...
r470 #include "scatterchartitem_p.h"
Marek Rosa
Renamed SplinePresenter to SplineChartItem
r460 #include "splinechartitem_p.h"
Michal Klocek
Refactors qchart , adds line animation...
r131
QTCOMMERCIALCHART_BEGIN_NAMESPACE
ChartPresenter::ChartPresenter(QChart* chart,ChartDataSet* dataset):QObject(chart),
Marek Rosa
Spline working somewhat
r401 m_chart(chart),
Michal Klocek
Animation refactor...
r530 m_animator(0),
Marek Rosa
Spline working somewhat
r401 m_dataset(dataset),
m_chartTheme(0),
Michal Klocek
Refactor domain model...
r439 m_zoomIndex(0),
Marek Rosa
Spline working somewhat
r401 m_marginSize(0),
Marek Rosa
Marge spline
r418 m_rect(QRectF(QPoint(0,0),m_chart->size())),
Michal Klocek
Refactor domain model...
r439 m_options(QChart::NoAnimation)
Michal Klocek
Refactors qchart , adds line animation...
r131 {
Marek Rosa
Spline working somewhat
r401 createConnections();
Michal Klocek
Adds missing ids to theme classes
r153 setChartTheme(QChart::ChartThemeDefault);
Michal Klocek
Refactors qchart , adds line animation...
r131 }
ChartPresenter::~ChartPresenter()
{
Michal Klocek
Adds scroll support...
r531 delete m_chartTheme;
Michal Klocek
Refactors qchart , adds line animation...
r131 }
Michal Klocek
Adds refactored axis to presenter
r140 void ChartPresenter::createConnections()
Michal Klocek
Refactors qchart , adds line animation...
r131 {
QObject::connect(m_chart,SIGNAL(geometryChanged()),this,SLOT(handleGeometryChanged()));
Michal Klocek
Refactor domain model...
r439 QObject::connect(m_dataset,SIGNAL(seriesAdded(QSeries*,Domain*)),this,SLOT(handleSeriesAdded(QSeries*,Domain*)));
Michal Klocek
Rename QChartSeries to QSeries
r360 QObject::connect(m_dataset,SIGNAL(seriesRemoved(QSeries*)),this,SLOT(handleSeriesRemoved(QSeries*)));
Michal Klocek
Refactor domain model...
r439 QObject::connect(m_dataset,SIGNAL(axisAdded(QChartAxis*,Domain*)),this,SLOT(handleAxisAdded(QChartAxis*,Domain*)));
Michal Klocek
Refactors axis handling...
r223 QObject::connect(m_dataset,SIGNAL(axisRemoved(QChartAxis*)),this,SLOT(handleAxisRemoved(QChartAxis*)));
}
QRectF ChartPresenter::geometry() const
{
return m_rect;
Michal Klocek
Refactors qchart , adds line animation...
r131 }
void ChartPresenter::handleGeometryChanged()
{
Michal Klocek
Refactor domain model...
r439 QRectF rect(QPoint(0,0),m_chart->size());
rect.adjust(m_marginSize,m_marginSize, -m_marginSize, -m_marginSize);
//rewrite zoom stack
for(int i=0;i<m_zoomStack.count();i++){
QRectF r = m_zoomStack[i];
qreal w = rect.width()/m_rect.width();
qreal h = rect.height()/m_rect.height();
QPointF tl = r.topLeft();
tl.setX(tl.x()*w);
tl.setY(tl.y()*h);
QPointF br = r.bottomRight();
br.setX(br.x()*w);
br.setY(br.y()*h);
r.setTopLeft(tl);
r.setBottomRight(br);
m_zoomStack[i]=r;
}
m_rect = rect;
Michal Klocek
Fix test application to have valid window size
r147 Q_ASSERT(m_rect.isValid());
Michal Klocek
Refactored for MVP...
r139 emit geometryChanged(m_rect);
}
Michal Klocek
Refactors qchart , adds line animation...
r131
Michal Klocek
Refactored for MVP...
r139 int ChartPresenter::margin() const
{
return m_marginSize;
}
Michal Klocek
Refactors qchart , adds line animation...
r131
Michal Klocek
Refactored for MVP...
r139 void ChartPresenter::setMargin(int margin)
{
m_marginSize = margin;
Michal Klocek
Refactors qchart , adds line animation...
r131 }
Michal Klocek
Refactor domain model...
r439 void ChartPresenter::handleAxisAdded(QChartAxis* axis,Domain* domain)
Michal Klocek
Refactors axis handling...
r223 {
Michal Klocek
Animation refactor...
r530 AxisItem* item = new AxisItem(axis,this,axis==m_dataset->axisX()?AxisItem::X_AXIS : AxisItem::Y_AXIS,m_chart);
Michal Klocek
Adds animation settings handling
r298
Michal Klocek
Animation refactor...
r530 if(m_options.testFlag(QChart::GridAxisAnimations)){
m_animator->addAnimation(item);
Michal Klocek
Refactor domain model...
r439 }
Michal Klocek
Animation refactor...
r530
Michal Klocek
Refactor domain model...
r439 if(axis==m_dataset->axisX()){
Michal Klocek
Fix theme decoration calls on all xyseries
r562 m_chartTheme->decorate(axis,true);
Michal Klocek
Adds scroll support...
r531 QObject::connect(domain,SIGNAL(rangeXChanged(qreal,qreal,int)),item,SLOT(handleRangeChanged(qreal,qreal,int)));
Michal Klocek
Refactor domain model...
r439 //initialize
Michal Klocek
Adds scroll support...
r531 item->handleRangeChanged(domain->minX(),domain->maxX(),domain->tickXCount());
Michal Klocek
Fix theme decoration calls on all xyseries
r562
Michal Klocek
Refactor domain model...
r439 }
else{
Michal Klocek
Fix theme decoration calls on all xyseries
r562 m_chartTheme->decorate(axis,false);
Michal Klocek
Adds scroll support...
r531 QObject::connect(domain,SIGNAL(rangeYChanged(qreal,qreal,int)),item,SLOT(handleRangeChanged(qreal,qreal,int)));
Michal Klocek
Refactor domain model...
r439 //initialize
Michal Klocek
Adds scroll support...
r531 item->handleRangeChanged(domain->minY(),domain->maxY(),domain->tickYCount());
Michal Klocek
Refactors axis handling...
r223 }
Michal Klocek
Adds animation settings handling
r298
Michal Klocek
Refactors axis handling...
r223 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),item,SLOT(handleGeometryChanged(const QRectF&)));
Michal Klocek
Refactor domain model...
r439 //initialize
Michal Klocek
Bugfix no geometry call when axis removed and added again
r259 item->handleGeometryChanged(m_rect);
Tero Ahola
Now using either vertical or horizontal grid shades
r561 m_axisItems.insert(axis, item);
Michal Klocek
Refactors axis handling...
r223 }
void ChartPresenter::handleAxisRemoved(QChartAxis* axis)
{
AxisItem* item = m_axisItems.take(axis);
Q_ASSERT(item);
Michal Klocek
Animation refactor...
r530 if(m_animator) m_animator->removeAnimation(item);
Michal Klocek
Refactors axis handling...
r223 delete item;
}
Michal Klocek
Refactor domain model...
r439 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain)
Michal Klocek
Refactors qchart , adds line animation...
r131 {
Michal Klocek
Adds scroll support...
r531 ChartItem *item = 0 ;
Michal Klocek
Refactors qchart , adds line animation...
r131 switch(series->type())
{
Marek Rosa
Marge spline
r418 case QSeries::SeriesTypeLine: {
Marek Rosa
Merge branch 'master' of https://git.it.local/repos/QtCommercialDevel-13049/charts...
r426
Marek Rosa
Marge spline
r418 QLineSeries* lineSeries = static_cast<QLineSeries*>(series);
Michal Klocek
Adds scroll support...
r531 LineChartItem* line = new LineChartItem(lineSeries,m_chart);
if(m_options.testFlag(QChart::SeriesAnimations)) {
m_animator->addAnimation(line);
Michal Klocek
Refactored for MVP...
r139 }
Michal Klocek
Fix theme decoration calls on all xyseries
r562 m_chartTheme->decorate(lineSeries, m_dataset->seriesIndex(series));
Michal Klocek
Adds scroll support...
r531 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),line,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),line,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
item = line;
Marek Rosa
Merge branch 'master' of https://git.it.local/repos/QtCommercialDevel-13049/charts...
r426 break;
}
Michal Klocek
Adds area chart...
r421
Marek Rosa
Merge branch 'master' of https://git.it.local/repos/QtCommercialDevel-13049/charts...
r426 case QSeries::SeriesTypeArea: {
Michal Klocek
Refactored for MVP...
r139
Marek Rosa
Merge branch 'master' of https://git.it.local/repos/QtCommercialDevel-13049/charts...
r426 QAreaSeries* areaSeries = static_cast<QAreaSeries*>(series);
Michal Klocek
Adds scroll support...
r531 AreaChartItem* area = new AreaChartItem(areaSeries,m_chart);
Marek Rosa
Merge branch 'master' of https://git.it.local/repos/QtCommercialDevel-13049/charts...
r426 if(m_options.testFlag(QChart::SeriesAnimations)) {
Michal Klocek
Adds area chart animations...
r560 m_animator->addAnimation(area->upperLineItem());
if(areaSeries->lowerSeries()) m_animator->addAnimation(area->lowerLineItem());
Michal Klocek
Refactors qchart , adds line animation...
r131 }
Michal Klocek
Fix theme decoration calls on all xyseries
r562 m_chartTheme->decorate(areaSeries, m_dataset->seriesIndex(series));
Michal Klocek
Adds scroll support...
r531 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),area,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),area,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
item=area;
Marek Rosa
Spline working somewhat
r401 break;
}
Michal Klocek
Refactored for MVP...
r139
Marek Rosa
Marge spline
r418 case QSeries::SeriesTypeBar: {
QBarSeries* barSeries = static_cast<QBarSeries*>(series);
Michal Klocek
Adds scroll support...
r531 BarPresenter* bar = new BarPresenter(barSeries,m_chart);
if(m_options.testFlag(QChart::SeriesAnimations)) {
// m_animator->addAnimation(bar);
}
Tero Ahola
Squashed bunch of warnings
r611 m_chartTheme->decorate(barSeries, m_dataset->seriesIndex(barSeries));
Michal Klocek
Adds scroll support...
r531 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
item=bar;
Marek Rosa
Spline working somewhat
r401 break;
}
Michal Klocek
Refactors qchart , adds line animation...
r131
Marek Rosa
Marge spline
r418 case QSeries::SeriesTypeStackedBar: {
QStackedBarSeries* stackedBarSeries = static_cast<QStackedBarSeries*>(series);
Michal Klocek
Adds scroll support...
r531 StackedBarPresenter* bar = new StackedBarPresenter(stackedBarSeries,m_chart);
if(m_options.testFlag(QChart::SeriesAnimations)) {
// m_animator->addAnimation(bar);
}
Tero Ahola
Squashed bunch of warnings
r611 m_chartTheme->decorate(stackedBarSeries, m_dataset->seriesIndex(stackedBarSeries));
Michal Klocek
Adds scroll support...
r531 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
item=bar;
Marek Rosa
Spline working somewhat
r401 break;
}
Michal Klocek
Refactored for MVP...
r139
Marek Rosa
Marge spline
r418 case QSeries::SeriesTypePercentBar: {
QPercentBarSeries* percentBarSeries = static_cast<QPercentBarSeries*>(series);
Michal Klocek
Adds scroll support...
r531 PercentBarPresenter* bar = new PercentBarPresenter(percentBarSeries,m_chart);
if(m_options.testFlag(QChart::SeriesAnimations)) {
// m_animator->addAnimation(bar);
}
Tero Ahola
Squashed bunch of warnings
r611 m_chartTheme->decorate(percentBarSeries, m_dataset->seriesIndex(percentBarSeries));
Michal Klocek
Adds scroll support...
r531 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
item=bar;
Marek Rosa
Spline working somewhat
r401 break;
}
Michal Klocek
Refactor animation to fit line,spline,scatter...
r476
Michal Klocek
Adds scroll support...
r531 case QSeries::SeriesTypeScatter: {
QScatterSeries *scatterSeries = static_cast<QScatterSeries *>(series);
Tero Ahola
Fixed bug with changing theme when several series exist
r538 ScatterChartItem *scatter = new ScatterChartItem(scatterSeries, m_chart);
if(m_options.testFlag(QChart::SeriesAnimations)) {
m_animator->addAnimation(scatter);
}
Michal Klocek
Fix theme decoration calls on all xyseries
r562 m_chartTheme->decorate(scatterSeries, m_dataset->seriesIndex(series));
Tero Ahola
Fixed bug with changing theme when several series exist
r538 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),scatter,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),scatter,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
item = scatter;
break;
Michal Klocek
Adds scroll support...
r531 }
Marek Rosa
Marge spline
r418
Michal Klocek
Adds scroll support...
r531 case QSeries::SeriesTypePie: {
QPieSeries *pieSeries = static_cast<QPieSeries *>(series);
Jani Honkonen
Rename piepresenter -> piechartitem
r568 PieChartItem* pie = new PieChartItem(m_chart, pieSeries);
Michal Klocek
Adds scroll support...
r531 if(m_options.testFlag(QChart::SeriesAnimations)) {
// m_animator->addAnimation(pie);
}
Tero Ahola
Squashed bunch of warnings
r611 m_chartTheme->decorate(pieSeries, m_dataset->seriesIndex(series));
Michal Klocek
Adds scroll support...
r531 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),pie,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),pie,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
Marek Rosa
Marge spline
r418 // Hide all from background when there is only piechart
// TODO: refactor this ugly code... should be one setting for this
if (m_chartItems.count() == 0) {
Michal Klocek
Adds axis show/hide to API
r534 m_chart->axisX()->hide();
m_chart->axisY()->hide();
Marek Rosa
Marge spline
r418 m_chart->setChartBackgroundBrush(Qt::transparent);
Michal Klocek
Refactors qchart , adds line animation...
r131 }
Michal Klocek
Adds scroll support...
r531 item=pie;
Marek Rosa
Spline working somewhat
r401 break;
}
Marek Rosa
Merge branch 'master' of https://git.it.local/repos/QtCommercialDevel-13049/charts...
r427
Marek Rosa
Spline with problems
r419 case QSeries::SeriesTypeSpline: {
Tero Ahola
Fixed bug with changing theme when several series exist
r538 QSplineSeries* splineSeries = static_cast<QSplineSeries*>(series);
SplineChartItem* spline = new SplineChartItem(splineSeries, m_chart);
if(m_options.testFlag(QChart::SeriesAnimations)) {
m_animator->addAnimation(spline);
}
Michal Klocek
Fix theme decoration calls on all xyseries
r562 m_chartTheme->decorate(splineSeries, m_dataset->seriesIndex(series));
Tero Ahola
Fixed bug with changing theme when several series exist
r538 QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),spline,SLOT(handleGeometryChanged(const QRectF&)));
QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),spline,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal)));
item=spline;
break;
}
Marek Rosa
Spline working somewhat
r401 default: {
qDebug()<< "Series type" << series->type() << "not implemented.";
Marek Rosa
Spline initial
r295 break;
}
Michal Klocek
Refactors qchart , adds line animation...
r131 }
Michal Klocek
Refactor domain model...
r439
Michal Klocek
Adds scroll support...
r531 //initialize
item->handleDomainChanged(domain->minX(),domain->maxX(),domain->minY(),domain->maxY());
if(m_rect.isValid()) item->handleGeometryChanged(m_rect);
m_chartItems.insert(series,item);
Michal Klocek
Refactor domain model...
r439 zoomReset();
Michal Klocek
Refactors qchart , adds line animation...
r131 }
Michal Klocek
Rename QChartSeries to QSeries
r360 void ChartPresenter::handleSeriesRemoved(QSeries* series)
Michal Klocek
Refactored for MVP...
r139 {
Marek Rosa
Spline working somewhat
r401 ChartItem* item = m_chartItems.take(series);
Michal Klocek
Animation refactor...
r530 Q_ASSERT(item);
Michal Klocek
Adds area chart animations...
r560 if(m_animator) {
//small hack to handle area animations
if(series->type()==QSeries::SeriesTypeArea){
QAreaSeries* areaSeries = static_cast<QAreaSeries*>(series);
AreaChartItem* area = static_cast<AreaChartItem*>(item);
m_animator->removeAnimation(area->upperLineItem());
if(areaSeries->lowerSeries()) m_animator->addAnimation(area->lowerLineItem());
}else
m_animator->removeAnimation(item);
}
Marek Rosa
Spline working somewhat
r401 delete item;
Michal Klocek
Refactored for MVP...
r139 }
Michal Klocek
Refactors qchart , adds line animation...
r131
Michal Klocek
Adds missing ids to theme classes
r153 void ChartPresenter::setChartTheme(QChart::ChartTheme theme)
Michal Klocek
Refactor themes...
r143 {
Michal Klocek
Adds scroll support...
r531 if(m_chartTheme && m_chartTheme->id() == theme) return;
Michal Klocek
Refactor themes...
r143 delete m_chartTheme;
m_chartTheme = ChartTheme::createTheme(theme);
Michal Klocek
Removes helper from cherttheme
r532 m_chartTheme->decorate(m_chart);
sauimone
background to legend, theme applies
r540 m_chartTheme->decorate(m_chart->legend());
Michal Klocek
Adds scroll support...
r531 resetAllElements();
Michal Klocek
Adds more axis handling...
r176 }
Michal Klocek
Adds missing ids to theme classes
r153 QChart::ChartTheme ChartPresenter::chartTheme()
Michal Klocek
Refactor themes...
r143 {
Michal Klocek
Adds missing ids to theme classes
r153 return m_chartTheme->id();
}
Michal Klocek
Adds animation settings handling
r298 void ChartPresenter::setAnimationOptions(QChart::AnimationOptions options)
{
if(m_options!=options) {
m_options=options;
Michal Klocek
Animation refactor...
r530 if(m_options!=QChart::NoAnimation && !m_animator) {
m_animator= new ChartAnimator(this);
Michal Klocek
Adds animation settings handling
r298 }
Michal Klocek
Adds scroll support...
r531 resetAllElements();
Michal Klocek
Adds animation settings handling
r298 }
Michal Klocek
Animation refactor...
r530
Michal Klocek
Adds animation settings handling
r298 }
Michal Klocek
Adds scroll support...
r531 void ChartPresenter::resetAllElements()
{
QList<QChartAxis*> axisList = m_axisItems.uniqueKeys();
QList<QSeries*> seriesList = m_chartItems.uniqueKeys();
foreach(QChartAxis* axis, axisList) {
handleAxisRemoved(axis);
handleAxisAdded(axis,m_dataset->domain(axis));
}
foreach(QSeries* series, seriesList) {
handleSeriesRemoved(series);
handleSeriesAdded(series,m_dataset->domain(series));
}
}
Michal Klocek
Refactor domain model...
r439 void ChartPresenter::zoomIn()
{
QRectF rect = geometry();
rect.setWidth(rect.width()/2);
rect.setHeight(rect.height()/2);
rect.moveCenter(geometry().center());
zoomIn(rect);
}
void ChartPresenter::zoomIn(const QRectF& rect)
{
QRectF r = rect.normalized();
r.translate(-m_marginSize, -m_marginSize);
Michal Klocek
Adds scroll support...
r531 if(m_animator) {
QPointF point(r.center().x()/geometry().width(),r.center().y()/geometry().height());
m_animator->setState(ChartAnimator::ZoomInState,point);
}
Michal Klocek
Refactor domain model...
r439 m_dataset->zoomInDomain(r,geometry().size());
m_zoomStack<<r;
m_zoomIndex++;
Michal Klocek
Adds scroll support...
r531 if(m_animator) {
m_animator->setState(ChartAnimator::ShowState);
}
Michal Klocek
Refactor domain model...
r439 }
void ChartPresenter::zoomOut()
{
if(m_zoomIndex==0) return;
Michal Klocek
Adds scroll support...
r531 if(m_animator)
{
m_animator->setState(ChartAnimator::ZoomOutState);
}
Michal Klocek
Refactor domain model...
r439 m_dataset->zoomOutDomain(m_zoomStack[m_zoomIndex-1],geometry().size());
m_zoomIndex--;
m_zoomStack.resize(m_zoomIndex);
Michal Klocek
Adds scroll support...
r531 if(m_animator){
m_animator->setState(ChartAnimator::ShowState);
}
Michal Klocek
Refactor domain model...
r439 }
void ChartPresenter::zoomReset()
{
m_zoomIndex=0;
m_zoomStack.resize(m_zoomIndex);
}
Michal Klocek
Adds scroll support...
r531 void ChartPresenter::scroll(int dx,int dy)
{
if(m_animator){
if(dx<0) m_animator->setState(ChartAnimator::ScrollLeftState,QPointF());
if(dx>0) m_animator->setState(ChartAnimator::ScrollRightState,QPointF());
if(dy<0) m_animator->setState(ChartAnimator::ScrollUpState,QPointF());
if(dy>0) m_animator->setState(ChartAnimator::ScrollDownState,QPointF());
}
m_dataset->scrollDomain(dx,dy,geometry().size());
sauimone
Separated legend marker to private header. Added signals for left and right mouse click
r547 if(m_animator){
Michal Klocek
Adds scroll support...
r531 m_animator->setState(ChartAnimator::ShowState);
}
}
Michal Klocek
Adds animation settings handling
r298 QChart::AnimationOptions ChartPresenter::animationOptions() const
{
return m_options;
}
Michal Klocek
Refactor themes...
r143
Michal Klocek
Refactors qchart , adds line animation...
r131 #include "moc_chartpresenter_p.cpp"
QTCOMMERCIALCHART_END_NAMESPACE