##// END OF EJS Templates
Fix BC: QChart::setMinimumMargins and QChart::minimumMargins are in v1.1.0 so they have to stay.
Fix BC: QChart::setMinimumMargins and QChart::minimumMargins are in v1.1.0 so they have to stay.

File last commit:

r2131:730996457e67
r2272:b1616762bd1e old_master
Show More
chartdataset.cpp
495 lines | 12.8 KiB | text/x-c | CppLexer
/ src / chartdataset.cpp
Michal Klocek
Updates chartdataset unit test
r771 /****************************************************************************
**
** Copyright (C) 2012 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
** This file is part of the Qt Commercial Charts Add-on.
**
** $QT_BEGIN_LICENSE$
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.digia.com
** $QT_END_LICENSE$
**
****************************************************************************/
Michal Klocek
Refactors qchart , adds line animation...
r131 #include "chartdataset_p.h"
Jani Honkonen
Implemented QAbstractSeries::chart()...
r1314 #include "qchart.h"
Marek Rosa
renamed QValueAxis related files
r1805 #include "qvalueaxis.h"
Marek Rosa
renamed QBarCategoryAxis related files
r1810 #include "qbarcategoryaxis.h"
Marek Rosa
renamed QValueAxis related files
r1805 #include "qvalueaxis_p.h"
Marek Rosa
Renamed QCategoryAxis related files
r1817 #include "qcategoryaxis.h"
Tero Ahola
Renamed QSeries to QAbstractSeries
r988 #include "qabstractseries_p.h"
sauimone
renamed barseries files to abstractbarseries
r1586 #include "qabstractbarseries.h"
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 #include "qstackedbarseries.h"
#include "qpercentbarseries.h"
Jani Honkonen
Moved pie stuff to own .pri file and rename stuff
r146 #include "qpieseries.h"
Michal Klocek
Refactors qchart , adds line animation...
r131
Marek Rosa
Disabled QDateTimeAxis on ARM
r1867 #ifndef QT_ON_ARM
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 #include "qdatetimeaxis.h"
Marek Rosa
Disabled QDateTimeAxis on ARM
r1867 #endif
Michal Klocek
Refactors qchart , adds line animation...
r131 QTCOMMERCIALCHART_BEGIN_NAMESPACE
Jani Honkonen
more coding style fixes for src-folder...
r2104 ChartDataSet::ChartDataSet(QChart *parent)
: QObject(parent)
Michal Klocek
Refactors qchart , adds line animation...
r131 {
Michal Klocek
Refactors core to support mulitpile axis and domains...
r1556
Michal Klocek
Refactors qchart , adds line animation...
r131 }
ChartDataSet::~ChartDataSet()
{
Michal Klocek
Adds if series deleted , remove series from chart
r1062 removeAllSeries();
Michal Klocek
Refactors qchart , adds line animation...
r131 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::addSeries(QAbstractSeries *series)
Michal Klocek
Refactors qchart , adds line animation...
r131 {
Jani Honkonen
more coding style fixes for src-folder...
r2104 Domain *domain = m_seriesDomainMap.value(series);
Michal Klocek
Fix indexing issue of series
r910
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (domain) {
Michal Klocek
Refactor domain model...
r439 qWarning() << "Can not add series. Series already on the chart";
return;
}
Michal Klocek
Refactors axis handling...
r223
Michal Klocek
Adds axis domain intialization
r1695 domain = new Domain(series);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 m_seriesDomainMap.insert(series, domain);
Michal Klocek
Adds axis domain intialization
r1695 series->d_ptr->scaleDomain(*domain);
createSeriesIndex(series);
Michal Klocek
Krazy reported errors...
r974 series->setParent(this); // take ownership
Jani Honkonen
more coding style fixes for src-folder...
r2104 series->d_ptr->m_chart = qobject_cast<QChart *>(parent());
Michal Klocek
Adds axis domain intialization
r1695 series->d_ptr->m_dataset = this;
Michal Klocek
Refactors axis handling...
r223
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 emit seriesAdded(series, domain);
Michal Klocek
Adds area chart...
r421
Michal Klocek
Adds axis domain intialization
r1695 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::removeSeries(QAbstractSeries *series)
Michal Klocek
Adds axis domain intialization
r1695 {
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (!m_seriesDomainMap.contains(series)) {
qWarning() << "Can not remove series. Series not found on the chart.";
Michal Klocek
Adds axis domain intialization
r1695 return;
}
emit seriesRemoved(series);
Jani Honkonen
more coding style fixes for src-folder...
r2104 Domain *domain = m_seriesDomainMap.take(series);
Michal Klocek
Adds axis domain intialization
r1695 delete domain;
domain = 0;
removeSeriesIndex(series);
series->setParent(0);
series->d_ptr->m_chart = 0;
series->d_ptr->m_dataset = 0;
removeAxes(series);
}
Michal Klocek
Adds area chart...
r421
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943
Michal Klocek
Adds axis domain intialization
r1695
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::createSeriesIndex(QAbstractSeries *series)
Michal Klocek
Adds axis domain intialization
r1695 {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<int, QAbstractSeries *> i(m_indexSeriesMap);
Michal Klocek
Fix indexing issue of series
r910
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 int key = 0;
Michal Klocek
Fix indexing issue of series
r910 while (i.hasNext()) {
i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (i.key() != key)
Michal Klocek
Fix indexing issue of series
r910 break;
key++;
}
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 m_indexSeriesMap.insert(key, series);
Michal Klocek
Adds axis domain intialization
r1695 }
Michal Klocek
Fix indexing issue of series
r910
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::removeSeriesIndex(QAbstractSeries *series)
Michal Klocek
Adds axis domain intialization
r1695 {
int key = seriesIndex(series);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 Q_ASSERT(key != -1);
Michal Klocek
Adds axis domain intialization
r1695 m_indexSeriesMap.remove(key);
Michal Klocek
Refactor domain model...
r439 }
Jani Honkonen
Pie chart refactoring
r142
Michal Klocek
Refactor QChart API...
r1577 void ChartDataSet::createDefaultAxes()
{
Tero Ahola
Refactored QML axis handling
r1813 if (m_seriesDomainMap.isEmpty())
return;
Michal Klocek
Adds createDefaultAxes logic
r1588
QAbstractAxis::AxisTypes typeX(0);
QAbstractAxis::AxisTypes typeY(0);
Tero Ahola
Refactored QML axis handling
r1813 // Remove possibly existing axes
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, Domain *> i(m_seriesDomainMap);
Michal Klocek
Refactor QChart API...
r1577 while (i.hasNext()) {
Marek Rosa
Added QDateTimeAxis
r1717 i.next();
removeAxes(i.key());
Michal Klocek
Adds createDefaultAxes logic
r1588 }
Michal Klocek
Refactor QChart API...
r1577
Michal Klocek
Adds createDefaultAxes logic
r1588 i.toFront();
Michal Klocek
Refactor QChart API...
r1577
Tero Ahola
Refactored QML axis handling
r1813 // Select the required axis x and axis y types based on the types of the current series
Michal Klocek
Adds createDefaultAxes logic
r1588 while (i.hasNext()) {
Marek Rosa
Added QDateTimeAxis
r1717 i.next();
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *axisX = m_seriesAxisXMap.value(i.key());
QAbstractAxis *axisY = m_seriesAxisYMap.value(i.key());
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axisX)
typeX &= axisX->type();
else
typeX |= i.key()->d_ptr->defaultAxisType(Qt::Horizontal);
if (axisY)
typeY &= axisY->type();
else
typeY |= i.key()->d_ptr->defaultAxisType(Qt::Vertical);
Michal Klocek
Adds createDefaultAxes logic
r1588 }
Michal Klocek
Refactor QChart API...
r1577
Tero Ahola
Refactored QML axis handling
r1813 // Create the axes of the types selected
createAxes(typeX, Qt::Horizontal);
createAxes(typeY, Qt::Vertical);
Michal Klocek
Adds axis domain intialization
r1695 }
Michal Klocek
Refactor QChart API...
r1577
Tero Ahola
Refactored QML axis handling
r1813 void ChartDataSet::createAxes(QAbstractAxis::AxisTypes type, Qt::Orientation orientation)
Michal Klocek
Adds axis domain intialization
r1695 {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, Domain *> i(m_seriesDomainMap);
Michal Klocek
Adds axis domain intialization
r1695
Tero Ahola
Refactored QML axis handling
r1813 // TODO: Add a descriptive comment of what happens here
Marek Rosa
updated AxisType names
r1818 if (type.testFlag(QAbstractAxis::AxisTypeValue) && type.testFlag(QAbstractAxis::AxisTypeBarCategory)) {
Michal Klocek
Adds createDefaultAxes logic
r1588 while (i.hasNext()) {
Michal Klocek
Adds axis domain intialization
r1695 i.next();
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *axis = createAxis(i.key()->d_ptr->defaultAxisType(orientation), orientation);
Tero Ahola
Refactored QML axis handling
r1813 if (axis) {
initializeAxis(axis, i.key());
emit axisAdded(axis, i.value());
}
Michal Klocek
Refactor QChart API...
r1577 }
Tero Ahola
Refactored QML axis handling
r1813 } else if (!type.testFlag(QAbstractAxis::AxisTypeNoAxis)) {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *axis = createAxis(QAbstractAxis::AxisType(int(type)), orientation);
Michal Klocek
Adds createDefaultAxes logic
r1588 i.toFront();
while (i.hasNext()) {
Michal Klocek
Adds axis domain intialization
r1695 i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 initializeAxis(axis, i.key());
Michal Klocek
Refactor QChart API...
r1577 }
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 emit axisAdded(axis, i.value());
Michal Klocek
Refactor QChart API...
r1577 }
}
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *ChartDataSet::createAxis(QAbstractAxis::AxisType type, Qt::Orientation orientation)
Michal Klocek
Adds createDefaultAxes logic
r1588 {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *axis = 0;
Michal Klocek
Adds createDefaultAxes logic
r1588
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 switch (type) {
Marek Rosa
updated AxisType names
r1818 case QAbstractAxis::AxisTypeValue:
Marek Rosa
class QValuesAxis renamed to QValueAxis
r1804 axis = new QValueAxis(this);
Michal Klocek
Adds createDefaultAxes logic
r1588 break;
Marek Rosa
updated AxisType names
r1818 case QAbstractAxis::AxisTypeBarCategory:
Marek Rosa
QBarCategoriesAxis renamed to QBarCategoryAxis
r1808 axis = new QBarCategoryAxis(this);
Michal Klocek
Adds createDefaultAxes logic
r1588 break;
Marek Rosa
updated AxisType names
r1818 case QAbstractAxis::AxisTypeCategory:
Marek Rosa
QIntervalsAxis renamed to QCategoryAxis
r1816 axis = new QCategoryAxis(this);
Marek Rosa
Added QDateTimeAxis
r1717 break;
Marek Rosa
Disabled QDateTimeAxis on ARM
r1867 #ifndef Q_WS_QWS
Marek Rosa
Added QDateTimeAxis
r1717 case QAbstractAxis::AxisTypeDateTime:
axis = new QDateTimeAxis(this);
break;
Marek Rosa
Disabled QDateTimeAxis on ARM
r1867 #endif
Marek Rosa
Added QDateTimeAxis
r1717 default:
Michal Klocek
Adds createDefaultAxes logic
r1588 axis = 0;
break;
}
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axis)
Michal Klocek
Refactors Domain and Axis...
r1698 axis->d_ptr->setOrientation(orientation);
Michal Klocek
Adds createDefaultAxes logic
r1588
Michal Klocek
Adds axis domain intialization
r1695 return axis;
Michal Klocek
Adds createDefaultAxes logic
r1588 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::initializeAxis(QAbstractAxis *axis, QAbstractSeries *series)
Michal Klocek
Refactor domain model...
r439 {
Jani Honkonen
more coding style fixes for src-folder...
r2104 Domain *domain = m_seriesDomainMap.value(series);
Michal Klocek
Implements qbarcategoriesaxis logic...
r1725 axis->d_ptr->m_dataset = this;
Michal Klocek
Adds axis domain intialization
r1695 series->d_ptr->initializeAxis(axis);
Michal Klocek
Add autoscale support to barcategoriesaxis
r1764 axis->d_ptr->intializeDomain(domain);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axis->orientation() == Qt::Horizontal) {
QObject::connect(axis->d_ptr.data(), SIGNAL(updated()), domain, SLOT(handleAxisUpdated()));
QObject::connect(domain, SIGNAL(updated()), axis->d_ptr.data(), SLOT(handleDomainUpdated()));
m_seriesAxisXMap.insert(series, axis);
} else {
QObject::connect(axis->d_ptr.data(), SIGNAL(updated()), domain, SLOT(handleAxisUpdated()));
QObject::connect(domain, SIGNAL(updated()), axis->d_ptr.data(), SLOT(handleDomainUpdated()));
m_seriesAxisYMap.insert(series, axis);
Michal Klocek
Adds axis domain intialization
r1695 }
Michal Klocek
Refactors Domain and Axis...
r1698 axis->d_ptr->emitUpdated();
Michal Klocek
Adds createDefaultAxes logic
r1588 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::removeAxes(QAbstractSeries *series)
Michal Klocek
Adds createDefaultAxes logic
r1588 {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *axisX = m_seriesAxisXMap.take(series);
Michal Klocek
Fix indexing issue of series
r910
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axisX) {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QList<QAbstractAxis *> axesX = m_seriesAxisXMap.values();
Michal Klocek
Update of chartdataset_tst
r1564 int x = axesX.indexOf(axisX);
Michal Klocek
Refactors axis handling...
r223
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (x == -1) {
Michal Klocek
Update of chartdataset_tst
r1564 emit axisRemoved(axisX);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 axisX->d_ptr->m_dataset = 0;
Michal Klocek
Fix deleteLater in case presenter keeps deleteLater objects
r1569 axisX->deleteLater();
Michal Klocek
Update of chartdataset_tst
r1564 }
Michal Klocek
Refactor domain model...
r439 }
Michal Klocek
Refactors axis handling...
r223
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *axisY = m_seriesAxisYMap.take(series);
Michal Klocek
Update of chartdataset_tst
r1564
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axisY) {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QList<QAbstractAxis *> axesY = m_seriesAxisYMap.values();
Michal Klocek
Update of chartdataset_tst
r1564
int y = axesY.indexOf(axisY);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (y == -1) {
Michal Klocek
Update of chartdataset_tst
r1564 emit axisRemoved(axisY);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 axisY->d_ptr->m_dataset = 0;
Michal Klocek
Fix deleteLater in case presenter keeps deleteLater objects
r1569 axisY->deleteLater();
Michal Klocek
Update of chartdataset_tst
r1564 }
Michal Klocek
Refactors axis handling...
r223 }
Michal Klocek
Refactored for MVP...
r139 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::removeAxis(QAbstractAxis *axis)
Michal Klocek
Implements qbarcategoriesaxis logic...
r1725 {
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (!axis->d_ptr->m_dataset) {
qWarning() << "UnBound axis found !";
Michal Klocek
Implements qbarcategoriesaxis logic...
r1725 return;
}
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMap<QAbstractSeries *, QAbstractAxis *> *seriesAxisMap;
Michal Klocek
Implements qbarcategoriesaxis logic...
r1725
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axis->orientation() == Qt::Vertical)
seriesAxisMap = &m_seriesAxisYMap;
else
seriesAxisMap = &m_seriesAxisXMap;
Michal Klocek
Implements qbarcategoriesaxis logic...
r1725
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, QAbstractAxis *> i(*seriesAxisMap);
Michal Klocek
Implements qbarcategoriesaxis logic...
r1725
while (i.hasNext()) {
i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (i.value() == axis)
Michal Klocek
Implements qbarcategoriesaxis logic...
r1725 removeSeries(i.key());
}
}
Michal Klocek
Adds RemoveAllSeries method to API
r258 void ChartDataSet::removeAllSeries()
{
Jani Honkonen
src folder: another massive victory for coding style police
r2131 QList<QAbstractSeries *> series = m_seriesDomainMap.keys();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 foreach (QAbstractSeries *s , series)
Michal Klocek
Refactors core to support mulitpile axis and domains...
r1556 removeSeries(s);
Michal Klocek
Refactored for MVP...
r139
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 Q_ASSERT(m_seriesAxisXMap.count() == 0);
Q_ASSERT(m_seriesAxisXMap.count() == 0);
Q_ASSERT(m_seriesDomainMap.count() == 0);
Michal Klocek
Fix indexing issue of series
r910
Michal Klocek
Krazy reported errors...
r974 qDeleteAll(series);
Michal Klocek
Refactored for MVP...
r139 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::zoomInDomain(const QRectF &rect, const QSizeF &size)
Michal Klocek
Refactored for MVP...
r139 {
Michal Klocek
Fix all tst_chartdataset test cases
r1593 //for performance reasons block, signals and scale "full" domain one by one. Gives twice less screen updates
Michal Klocek
Fixes tst_qchartview
r1652
Michal Klocek
Fix all tst_chartdataset test cases
r1593 blockAxisSignals(true);
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, Domain *> i(m_seriesDomainMap);
Michal Klocek
Fix all tst_chartdataset test cases
r1593
Michal Klocek
Refactor domain model...
r439 while (i.hasNext()) {
i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 i.value()->zoomIn(rect, size);
Michal Klocek
Refactors axis handling...
r223 }
Michal Klocek
Fix all tst_chartdataset test cases
r1593
blockAxisSignals(false);
Michal Klocek
Refactor domain model...
r439 }
Michal Klocek
Refactors axis handling...
r223
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::zoomOutDomain(const QRectF &rect, const QSizeF &size)
Michal Klocek
Refactor domain model...
r439 {
Michal Klocek
Fix all tst_chartdataset test cases
r1593 //for performance reasons block, signals and scale "full" domain one by one. Gives twice less screen updates
blockAxisSignals(true);
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, Domain *> i(m_seriesDomainMap);
Michal Klocek
Fix all tst_chartdataset test cases
r1593
Michal Klocek
Refactor domain model...
r439 while (i.hasNext()) {
i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 i.value()->zoomOut(rect, size);
Michal Klocek
Refactor domain model...
r439 }
Michal Klocek
Fix all tst_chartdataset test cases
r1593
blockAxisSignals(false);
}
void ChartDataSet::blockAxisSignals(bool enabled)
{
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, Domain *> i(m_seriesDomainMap);
Michal Klocek
Fix all tst_chartdataset test cases
r1593 while (i.hasNext()) {
Marek Rosa
Added QDateTimeAxis
r1717 i.next();
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *axisX = m_seriesAxisXMap.value(i.key());
QAbstractAxis *axisY = m_seriesAxisYMap.value(i.key());
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axisX) {
Michal Klocek
Fixes nicenumbers missing update issue
r1738 axisX->d_ptr->blockSignals(enabled);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (!enabled) {
Michal Klocek
Fixes nicenumbers missing update issue
r1738 axisX->d_ptr->setDirty(false);
axisX->d_ptr->emitUpdated();
}
}
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axisY) {
Michal Klocek
Fixes nicenumbers missing update issue
r1738 axisY->d_ptr->blockSignals(enabled);
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (!enabled) {
Michal Klocek
Fixes nicenumbers missing update issue
r1738 axisY->d_ptr->setDirty(false);
axisY->d_ptr->emitUpdated();
}
}
Marek Rosa
Added QDateTimeAxis
r1717 }
Michal Klocek
Refactors axis handling...
r223 }
Michal Klocek
Fixes to API , QSeriesType -> SeriesType , add missing getters
r1107 int ChartDataSet::seriesCount(QAbstractSeries::SeriesType type)
Michal Klocek
Fix indexing issue of series
r910 {
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 int count = 0;
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, Domain *> i(m_seriesDomainMap);
Michal Klocek
Fix indexing issue of series
r910 while (i.hasNext()) {
Marek Rosa
Added QDateTimeAxis
r1717 i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (i.key()->type() == type)
count++;
Michal Klocek
Fix indexing issue of series
r910 }
return count;
}
Tero Ahola
Renamed QSeries to QAbstractSeries
r988 int ChartDataSet::seriesIndex(QAbstractSeries *series)
Tero Ahola
Fixed bug with changing theme when several series exist
r538 {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<int, QAbstractSeries *> i(m_indexSeriesMap);
Michal Klocek
Fix indexing issue of series
r910 while (i.hasNext()) {
i.next();
if (i.value() == series)
return i.key();
Tero Ahola
Fixed bug with changing theme when several series exist
r538 }
Tero Ahola
Reserve ordering of chart series internally....
r825 return -1;
Tero Ahola
Fixed bug with changing theme when several series exist
r538 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *ChartDataSet::axisX(QAbstractSeries *series) const
sauimone
added map for yaxises methods to set axis
r1554 {
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (series == 0) {
Michal Klocek
Adds return of visible axes
r1641
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, QAbstractAxis *> i(m_seriesAxisXMap);
Michal Klocek
Adds return of visible axes
r1641
Marek Rosa
Added QDateTimeAxis
r1717 while (i.hasNext()) {
i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (i.value()->isVisible())
return i.value();
Marek Rosa
Added QDateTimeAxis
r1717 }
return 0;
Michal Klocek
Adds return of visible axes
r1641 }
sauimone
added map for yaxises methods to set axis
r1554 return m_seriesAxisXMap.value(series);
}
Jani Honkonen
more coding style fixes for src-folder...
r2104 QAbstractAxis *ChartDataSet::axisY(QAbstractSeries *series) const
Michal Klocek
Refactors axis handling...
r223 {
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (series == 0) {
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, QAbstractAxis *> i(m_seriesAxisYMap);
Michal Klocek
Adds return of visible axes
r1641
while (i.hasNext()) {
i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (i.value()->isVisible()) return i.value();
Michal Klocek
Adds return of visible axes
r1641 }
return 0;
}
sauimone
added map for yaxises methods to set axis
r1554 return m_seriesAxisYMap.value(series);
Michal Klocek
Refactors axis handling...
r223 }
Michal Klocek
Adds axis domain intialization
r1695 void ChartDataSet::setAxis(QAbstractSeries *series, QAbstractAxis *axis, Qt::Orientation orientation)
sauimone
added map for yaxises methods to set axis
r1554 {
Michal Klocek
Update of chartdataset_tst
r1564 Q_ASSERT(axis);
Michal Klocek
Adds axis domain intialization
r1695
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (!series) {
Michal Klocek
Adds tst_qvaluesaxis stub implementation
r1699 qWarning() << "Series not found on the chart.";
return;
}
Jani Honkonen
more coding style fixes for src-folder...
r2104 Domain *domain = m_seriesDomainMap.value(series);
Michal Klocek
Update of chartdataset_tst
r1564
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (!domain) {
Michal Klocek
Refactor QChart API...
r1577 qWarning() << "Series not found on the chart.";
return;
Michal Klocek
Update of chartdataset_tst
r1564 }
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (orientation == Qt::Horizontal && axis->orientation() == Qt::Vertical) {
qWarning() << "Axis already defined as axis Y";
Michal Klocek
Refactor QChart API...
r1577 return;
Michal Klocek
Update of chartdataset_tst
r1564 }
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (orientation == Qt::Vertical && axis->orientation() == Qt::Horizontal) {
qWarning() << "Axis already defined as axis X";
Michal Klocek
Adds axis domain intialization
r1695 return;
Michal Klocek
Update of chartdataset_tst
r1564 }
Michal Klocek
Refactors Domain and Axis...
r1698 axis->d_ptr->setOrientation(orientation);
sauimone
added map for yaxises methods to set axis
r1554
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMap<QAbstractSeries *, QAbstractAxis *> *seriesAxisMap;
Michal Klocek
Update of chartdataset_tst
r1564
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (orientation == Qt::Vertical)
seriesAxisMap = &m_seriesAxisYMap;
else
seriesAxisMap = &m_seriesAxisXMap;
Michal Klocek
Update of chartdataset_tst
r1564
Tero Ahola
Refactored QML axis handling
r1813 if (seriesAxisMap->value(series) == axis) {
qWarning() << "The axis already set for the series";
return;
}
Michal Klocek
Adds axis domain intialization
r1695 QAbstractAxis *oldAxis = seriesAxisMap->take(series);
Jani Honkonen
more coding style fixes for src-folder...
r2104 QList<QAbstractAxis *> axes = seriesAxisMap->values();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (oldAxis) {
if (axes.indexOf(oldAxis) == -1) {
Michal Klocek
Refactor QChart API...
r1577 emit axisRemoved(oldAxis);
Michal Klocek
Refactor Visibly methods of axis...
r1729 oldAxis->disconnect();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 QObject::disconnect(domain, 0, oldAxis, 0);
oldAxis->d_ptr->m_dataset = 0;
Michal Klocek
Refactor QChart API...
r1577 oldAxis->deleteLater();
}
}
Michal Klocek
Update of chartdataset_tst
r1564
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 if (axes.indexOf(axis) == -1) {
initializeAxis(axis, series);
emit axisAdded(axis, domain);
} else {
initializeAxis(axis, series);
Michal Klocek
Update of chartdataset_tst
r1564 }
}
Jani Honkonen
more coding style fixes for src-folder...
r2104 Domain *ChartDataSet::domain(QAbstractSeries *series) const
Michal Klocek
Update of chartdataset_tst
r1564 {
return m_seriesDomainMap.value(series);
Michal Klocek
Adds missing functions to qchart API
r1542 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 void ChartDataSet::scrollDomain(qreal dx, qreal dy, const QSizeF &size)
Michal Klocek
Adds scroll support...
r531 {
Michal Klocek
Fix all tst_chartdataset test cases
r1593 blockAxisSignals(true);
Jani Honkonen
more coding style fixes for src-folder...
r2104 QMapIterator<QAbstractSeries *, Domain *> i(m_seriesDomainMap);
Michal Klocek
Refactor axis hadnling...
r1078 while (i.hasNext()) {
i.next();
Jani Honkonen
astyle and manual coding style fixes for src-folder
r2097 i.value()->move(dx, dy, size);
Michal Klocek
Refactor axis hadnling...
r1078 }
Michal Klocek
Fix all tst_chartdataset test cases
r1593 blockAxisSignals(false);
Michal Klocek
Refactor axis hadnling...
r1078 }
Jani Honkonen
more coding style fixes for src-folder...
r2104 QList<QAbstractSeries *> ChartDataSet::series() const
Michal Klocek
Refactor axis hadnling...
r1078 {
Michal Klocek
Creates default initalization of axes
r1661 return m_seriesDomainMap.keys();
Michal Klocek
Adds scroll support...
r531 }
sauimone
legend private implemantation modified.
r2081 /*
sauimone
legend detach example. Bug fixes to legend.
r1263 void ChartDataSet::updateSeries(QAbstractSeries *series)
{
emit seriesUpdated(series);
}
sauimone
legend private implemantation modified.
r2081 */
Michal Klocek
Refactors qchart , adds line animation...
r131 #include "moc_chartdataset_p.cpp"
QTCOMMERCIALCHART_END_NAMESPACE