##// END OF EJS Templates
Add demos to docs
Add demos to docs

File last commit:

r901:087f347c6433
r921:d7675a9f645d
Show More
qbarseries.cpp
472 lines | 13.8 KiB | text/x-c | CppLexer
Jani Honkonen
Add license headers
r794 /****************************************************************************
**
** 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$
**
****************************************************************************/
sauimone
Improved bar chart series
r71 #include <QDebug>
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 #include "qbarseries.h"
sauimone
removed barchartseriesbase. functionality is now in model
r172 #include "qbarset.h"
#include "barchartmodel_p.h"
Marek Rosa
Fixed: QAbstractItemModel could be forward declaration
r862 #include <QAbstractItemModel>
Marek Rosa
BarSeries - renamed internal model getter to modelInternal. Some smaller changes to other files to have in headers forward declarations for model related members instead of include
r877 #include <QModelIndex>
sauimone
refactored barcharts. layout to derived classess other funtionality to base class
r126
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 QTCOMMERCIALCHART_BEGIN_NAMESPACE
sauimone
Documentation for bar charts
r313 /*!
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 \class QBarSeries
sauimone
Documentation for bar charts
r313 \brief part of QtCommercial chart API.
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 QBarSeries represents a series of data shown as bars. One QBarSeries can contain multible
QBarSet data sets. QBarSeries groups the data from sets to categories, which are defined
sauimone
replaced qbarcategory with qstringlist
r377 by QStringList.
sauimone
Documentation for bar charts
r313
sauimone
Updated barchart documentation
r319 \mainclass
sauimone
replaced qbarcategory with qstringlist
r377 \sa QBarSet, QStackedBarSeries, QPercentBarSeries
sauimone
Documentation for bar charts
r313 */
/*!
Michal Klocek
Rename QChartSeries to QSeries
r360 \fn virtual QSeriesType QBarSeries::type() const
sauimone
Documentation for bar charts
r313 \brief Returns type of series.
Michal Klocek
Rename QChartSeries to QSeries
r360 \sa QSeries, QSeriesType
sauimone
Documentation for bar charts
r313 */
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425
sauimone
Documentation for bar charts
r313 /*!
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 \fn void QBarSeries::showToolTip(QPoint pos, QString tip)
sauimone
Updated barchart documentation
r319 \brief \internal \a pos \a tip
sauimone
Documentation for bar charts
r313 */
/*!
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 Constructs empty QBarSeries. Parameter \a categories defines the categories for chart.
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 QBarSeries is QObject which is a child of a \a parent.
sauimone
Documentation for bar charts
r313 */
sauimone
minor code review fixes
r762 QBarSeries::QBarSeries(QBarCategories categories, QObject *parent) : QSeries(parent),
sauimone
minor code review fixes, part n
r763 m_internalModel(new BarChartModel(categories, this))
sauimone
Improved bar chart series
r71 {
sauimone
code review fixes
r764 m_model = 0;
Marek Rosa
QBar series: Model related members initializations added to constructor
r528 m_mapCategories = -1;
Jani Honkonen
We have so many stupid warnings that "treat warnings as errors" flag is needed...
r609 m_mapBarBottom = -1;
m_mapBarTop = -1;
Marek Rosa
XYSeries: added support for limited mapping area
r734 m_mapFirst = 0;
m_mapCount = 0;
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 m_mapOrientation = Qt::Vertical;
sauimone
Improved bar chart series
r71 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 Adds a set of bars to series. Takes ownership of \a set.
sauimone
combined clicked and rightclicked signals in barchart
r812 Connects the clicked(QString, Qt::MouseButtons) signal
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 of \a set to this series
sauimone
Documentation for bar charts
r313 */
sauimone
const to getters, renamed addBarset to appendBarset
r776 void QBarSeries::appendBarSet(QBarSet *set)
sauimone
Barset and barcategory implememtation. Updated test application
r171 {
sauimone
const to getters, renamed addBarset to appendBarset
r776 m_internalModel->appendBarSet(set);
sauimone
combined clicked and rightclicked signals in barchart
r812 connect(set, SIGNAL(clicked(QString,Qt::MouseButtons)), this, SLOT(barsetClicked(QString,Qt::MouseButtons)));
Marek Rosa
Barchart updates on BarSet->SetValue now
r655 connect(set, SIGNAL(valueChanged()), this, SLOT(barsetChanged()));
sauimone
percent barchart layout fix. signal fix
r850 emit restructuredBars();
sauimone
Barset and barcategory implememtation. Updated test application
r171 }
sauimone
Documentation for bar charts
r313 /*!
Removes a set of bars from series. Releases ownership of \a set. Doesnt delete \a set.
sauimone
combined clicked and rightclicked signals in barchart
r812 Disconnects the clicked(QString, Qt::MouseButtons) signal
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 of \a set from this series
sauimone
Documentation for bar charts
r313 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 void QBarSeries::removeBarSet(QBarSet *set)
sauimone
Barset and barcategory implememtation. Updated test application
r171 {
sauimone
combined clicked and rightclicked signals in barchart
r812 disconnect(set, SIGNAL(clicked(QString,Qt::MouseButtons)), this, SLOT(barsetClicked(QString,Qt::MouseButtons)));
sauimone
minor code review fixes, part n
r763 m_internalModel->removeBarSet(set);
sauimone
percent barchart layout fix. signal fix
r850 emit restructuredBars();
}
/*!
Adds a list of barsets to series. Takes ownership of \a sets.
Connects the clicked(QString, Qt::MouseButtons) signals
of \a sets to this series
*/
void QBarSeries::appendBarSets(QList<QBarSet* > sets)
{
foreach (QBarSet* barset, sets) {
m_internalModel->appendBarSet(barset);
connect(barset, SIGNAL(clicked(QString,Qt::MouseButtons)), this, SLOT(barsetClicked(QString,Qt::MouseButtons)));
connect(barset, SIGNAL(valueChanged()), this, SLOT(barsetChanged()));
}
emit restructuredBars();
}
/*!
Marek Rosa
Updated spline chart example documentation and added some more docs to barseries
r901 Removes a list of barsets from series. Releases ownership of \a sets. Doesnt delete \a sets.
sauimone
percent barchart layout fix. signal fix
r850 Disconnects the clicked(QString, Qt::MouseButtons) signal
of \a sets from this series
*/
void QBarSeries::removeBarSets(QList<QBarSet* > sets)
{
foreach (QBarSet* barset, sets) {
disconnect(barset, SIGNAL(clicked(QString,Qt::MouseButtons)), this, SLOT(barsetClicked(QString,Qt::MouseButtons)));
m_internalModel->removeBarSet(barset);
}
emit restructuredBars();
sauimone
removed barchartseriesbase. functionality is now in model
r172 }
Marek Rosa
Updated spline chart example documentation and added some more docs to barseries
r901 /*!
Inserts new \a set on the \a i position.
The barset that is currently at this postion is moved to postion i + 1
*/
Marek Rosa
Adding data to BarSet through model added
r662 void QBarSeries::insertBarSet(int i, QBarSet *set)
{
sauimone
minor code review fixes, part n
r763 m_internalModel->insertBarSet(i, set);
Marek Rosa
Adding data to BarSet through model added
r662 // emit barsetChanged();
}
Marek Rosa
Updated spline chart example documentation and added some more docs to barseries
r901 /*!
Inserts new \a category on the \a i position.
The category that is currently at this postion is moved to postion i + 1
\sa removeCategory()
*/
Marek Rosa
Adding data to BarSet through model added
r662 void QBarSeries::insertCategory(int i, QString category)
{
sauimone
minor code review fixes, part n
r763 m_internalModel->insertCategory(i, category);
Marek Rosa
Adding data to BarSet through model added
r662 }
Marek Rosa
Updated spline chart example documentation and added some more docs to barseries
r901 /*!
Removes the category specified by \a i
\sa insertCategory()
*/
Marek Rosa
Removing data from BarSeries through model added
r663 void QBarSeries::removeCategory(int i)
{
sauimone
minor code review fixes, part n
r763 m_internalModel->removeCategory(i);
Marek Rosa
Removing data from BarSeries through model added
r663 }
sauimone
Documentation for bar charts
r313 /*!
Returns number of sets in series.
*/
sauimone
const to getters, renamed addBarset to appendBarset
r776 int QBarSeries::barsetCount() const
sauimone
Added pen & brush to QBarSet
r214 {
Marek Rosa
Adding data to BarSet through model added
r662 // if(m_model)
// return m_mapBarTop - m_mapBarBottom;
// else
sauimone
minor code review fixes, part n
r763 return m_internalModel->barsetCount();
sauimone
Added pen & brush to QBarSet
r214 }
sauimone
exposing countcategories to user from barchartseries
r323 /*!
Returns number of categories in series
*/
sauimone
const to getters, renamed addBarset to appendBarset
r776 int QBarSeries::categoryCount() const
sauimone
exposing countcategories to user from barchartseries
r323 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->categoryCount();
sauimone
exposing countcategories to user from barchartseries
r323 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 Returns a list of sets in series. Keeps ownership of sets.
*/
sauimone
const to getters, renamed addBarset to appendBarset
r776 QList<QBarSet*> QBarSeries::barSets() const
sauimone
Added pen & brush to QBarSet
r214 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->barSets();
sauimone
Added pen & brush to QBarSet
r214 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 \internal \a index
sauimone
Documentation for bar charts
r313 */
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 QBarSet* QBarSeries::barsetAt(int index)
sauimone
moved tooltip to presenter
r288 {
sauimone
const to getters, renamed addBarset to appendBarset
r776 return m_internalModel->barsetAt(index);
sauimone
moved tooltip to presenter
r288 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal \a category
sauimone
Documentation for bar charts
r313 */
sauimone
right click feature for bar series. Enables drilldown
r412 QString QBarSeries::categoryName(int category)
sauimone
moved tooltip to presenter
r288 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->categoryName(category);
sauimone
moved tooltip to presenter
r288 }
sauimone
Documentation for bar charts
r313 /*!
Enables or disables tooltip depending on parameter \a enabled.
Tooltip shows the name of set, when mouse is hovering on top of bar.
Calling without parameter \a enabled, enables the tooltip
*/
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 void QBarSeries::setToolTipEnabled(bool enabled)
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 {
sauimone
Labels for barchart to axis
r487 // TODO: what if we add sets after call to this function? Those sets won't have tooltip enabled.
sauimone
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296 if (enabled) {
sauimone
minor code review fixes, part n
r763 for (int i=0; i<m_internalModel->barsetCount(); i++) {
sauimone
const to getters, renamed addBarset to appendBarset
r776 QBarSet *set = m_internalModel->barsetAt(i);
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 connect(set, SIGNAL(showToolTip(QPoint,QString)), this, SIGNAL(showToolTip(QPoint,QString)));
sauimone
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296 }
} else {
sauimone
minor code review fixes, part n
r763 for (int i=0; i<m_internalModel->barsetCount(); i++) {
sauimone
const to getters, renamed addBarset to appendBarset
r776 QBarSet *set = m_internalModel->barsetAt(i);
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 disconnect(set, SIGNAL(showToolTip(QPoint,QString)), this, SIGNAL(showToolTip(QPoint,QString)));
sauimone
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296 }
}
sauimone
moved tooltip to presenter
r288 }
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425
/*!
\internal \a category
*/
sauimone
combined clicked and rightclicked signals in barchart
r812 void QBarSeries::barsetClicked(QString category, Qt::MouseButtons button)
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 {
sauimone
combined clicked and rightclicked signals in barchart
r812 emit clicked(qobject_cast<QBarSet*>(sender()), category, button);
sauimone
Better way to enable features to user. Do less, but expose signals to user and allow user to descide what to do.
r425 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal
sauimone
Documentation for bar charts
r313 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 qreal QBarSeries::min()
sauimone
removed barchartseriesbase. functionality is now in model
r172 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->min();
sauimone
removed barchartseriesbase. functionality is now in model
r172 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal
sauimone
Documentation for bar charts
r313 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 qreal QBarSeries::max()
sauimone
removed barchartseriesbase. functionality is now in model
r172 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->max();
sauimone
Barset and barcategory implememtation. Updated test application
r171 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal \a set \a category
sauimone
Documentation for bar charts
r313 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 qreal QBarSeries::valueAt(int set, int category)
sauimone
removed barchartseriesbase. functionality is now in model
r172 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->valueAt(set, category);
sauimone
removed barchartseriesbase. functionality is now in model
r172 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal \a set \a category
sauimone
Documentation for bar charts
r313 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 qreal QBarSeries::percentageAt(int set, int category)
sauimone
moved tooltip to presenter
r288 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->percentageAt(set, category);
sauimone
moved tooltip to presenter
r288 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal \a category
sauimone
Documentation for bar charts
r313 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 qreal QBarSeries::categorySum(int category)
sauimone
moved tooltip to presenter
r288 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->categorySum(category);
sauimone
moved tooltip to presenter
r288 }
sauimone
percent barchart layout fix. signal fix
r850 /*!
\internal \a category
*/
qreal QBarSeries::absoluteCategorySum(int category)
{
return m_internalModel->absoluteCategorySum(category);
}
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal
sauimone
Documentation for bar charts
r313 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 qreal QBarSeries::maxCategorySum()
sauimone
removed barchartseriesbase. functionality is now in model
r172 {
sauimone
minor code review fixes, part n
r763 return m_internalModel->maxCategorySum();
sauimone
removed barchartseriesbase. functionality is now in model
r172 }
sauimone
Documentation for bar charts
r313 /*!
sauimone
Updated barchart documentation
r319 \internal
sauimone
Documentation for bar charts
r313 */
Marek Rosa
BarSeries - renamed internal model getter to modelInternal. Some smaller changes to other files to have in headers forward declarations for model related members instead of include
r877 BarChartModel& QBarSeries::modelInternal()
sauimone
removed barchartseriesbase. functionality is now in model
r172 {
sauimone
minor code review fixes, part n
r763 return *m_internalModel;
sauimone
removed barchartseriesbase. functionality is now in model
r172 }
Marek Rosa
Removed few commeneted out lines and documented few funtions
r879 /*!
\fn bool QBarSeries::setModel(QAbstractItemModel *model)
Sets the \a model to be used as a data source
*/
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 bool QBarSeries::setModel(QAbstractItemModel *model)
Marek Rosa
QXYSeries: model data orientation added. QBarSeries: some model data function placeholders
r527 {
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 // disconnect signals from old model
if(m_model)
{
disconnect(m_model, 0, this, 0);
m_mapCategories = -1;
m_mapBarBottom = -1;
m_mapBarTop = -1;
Marek Rosa
XYSeries: added support for limited mapping area
r734 m_mapFirst = 0;
m_mapCount = 0;
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 m_mapOrientation = Qt::Vertical;
}
// set new model
if(model)
{
m_model = model;
return true;
}
else
{
sauimone
code review fixes
r764 m_model = 0;
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 return false;
}
Marek Rosa
QXYSeries: model data orientation added. QBarSeries: some model data function placeholders
r527 }
Marek Rosa
Added documentation for model related funtions
r900 /*!
\fn bool QBarSeries::setModelMapping(int categories, int bottomBoundry, int topBoundry, Qt::Orientation orientation)
Sets column/row specified by \a categories to be used as a list of bar series categories.
Parameter \a bottomBoundry indicates the column/row where the first bar set is located in the model.
Parameter \a topBoundry indicates the column/row where the last bar set is located in the model.
All the columns/rows inbetween those two values are also used as data for bar sets.
The \a orientation paramater specifies whether the data is in columns or in rows.
*/
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 void QBarSeries::setModelMapping(int categories, int bottomBoundry, int topBoundry, Qt::Orientation orientation)
Marek Rosa
QXYSeries: model data orientation added. QBarSeries: some model data function placeholders
r527 {
sauimone
code review fixes
r764 if (!m_model)
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 return;
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 m_mapCategories = categories;
m_mapBarBottom = bottomBoundry;
m_mapBarTop = topBoundry;
Marek Rosa
Some more work on mapping with limits
r735 // m_mapFirst = 1;
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 m_mapOrientation = orientation;
// connect the signals
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 if (m_mapOrientation == Qt::Vertical) {
Marek Rosa
Some more work on mapping with limits
r735 m_mapCount = m_model->rowCount() - m_mapFirst;
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 connect(m_model,SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(modelUpdated(QModelIndex, QModelIndex)));
connect(m_model,SIGNAL(rowsInserted(QModelIndex, int, int)),
this, SLOT(modelDataAdded(QModelIndex,int,int)));
connect(m_model, SIGNAL(rowsRemoved(QModelIndex, int, int)),
this, SLOT(modelDataRemoved(QModelIndex,int,int)));
} else {
Marek Rosa
Some more work on mapping with limits
r735 m_mapCount = m_model->columnCount() - m_mapFirst;
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 connect(m_model,SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(modelUpdated(QModelIndex, QModelIndex)));
connect(m_model,SIGNAL(columnsInserted(QModelIndex, int, int)),
this, SLOT(modelDataAdded(QModelIndex,int,int)));
connect(m_model, SIGNAL(columnsRemoved(QModelIndex, int, int)),
this, SLOT(modelDataRemoved(QModelIndex,int,int)));
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 }
// create the initial bars
sauimone
minor code review fixes, part n
r763 delete m_internalModel;
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 if (m_mapOrientation == Qt::Vertical) {
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 QStringList categories;
Marek Rosa
XYSeries: added support for limited mapping area
r734 for (int k = m_mapFirst; k < m_mapFirst + m_mapCount; k++)
Marek Rosa
Fixes to BarSeries model update function
r650 categories << m_model->data(m_model->index(k, m_mapCategories), Qt::DisplayRole).toString();
sauimone
minor code review fixes, part n
r763 m_internalModel = new BarChartModel(categories, this);
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 for (int i = m_mapBarBottom; i <= m_mapBarTop; i++) {
Marek Rosa
Fixes to BarSeries model update function
r650 QBarSet* barSet = new QBarSet(QString("Column: %1").arg(i + 1));
Marek Rosa
XYSeries: added support for limited mapping area
r734 for(int m = m_mapFirst; m < m_mapFirst + m_mapCount; m++)
Marek Rosa
Fixes to BarSeries model update function
r650 *barSet << m_model->data(m_model->index(m, i), Qt::DisplayRole).toDouble();
sauimone
const to getters, renamed addBarset to appendBarset
r776 appendBarSet(barSet);
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 }
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 } else {
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 QStringList categories;
Marek Rosa
XYSeries: added support for limited mapping area
r734 for (int k = m_mapFirst; k < m_mapFirst + m_mapCount; k++)
Marek Rosa
Fixes to BarSeries model update function
r650 categories << m_model->data(m_model->index(m_mapCategories, k), Qt::DisplayRole).toString();
sauimone
minor code review fixes, part n
r763 m_internalModel = new BarChartModel(categories, this);
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 for (int i = m_mapBarBottom; i <= m_mapBarTop; i++) {
Marek Rosa
Fixes to BarSeries model update function
r650 QBarSet* barSet = new QBarSet(QString("Row: %1").arg(i + 1));
Marek Rosa
XYSeries: added support for limited mapping area
r734 for(int m = m_mapFirst; m < m_mapFirst + m_mapCount; m++)
Marek Rosa
Fixes to BarSeries model update function
r650 *barSet << m_model->data(m_model->index(i, m), Qt::DisplayRole).toDouble();
sauimone
const to getters, renamed addBarset to appendBarset
r776 appendBarSet(barSet);
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 }
}
Marek Rosa
QXYSeries: model data orientation added. QBarSeries: some model data function placeholders
r527 }
Marek Rosa
Added documentation for model related funtions
r900 /*!
\internal
*/
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 void QBarSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight)
{
Q_UNUSED(bottomRight)
if (m_mapOrientation == Qt::Vertical)
{
Marek Rosa
XYSeries: added support for limited mapping area
r734 // model update is relevant to BarSeries if the change was made to the part of the model that was mapped to BarSeries
if (topLeft.column() >= m_mapBarBottom && topLeft.column() <= m_mapBarTop && topLeft.row() >= m_mapFirst && topLeft.row() < m_mapFirst + m_mapCount)
barsetAt(topLeft.column() - m_mapBarBottom)->setValue(topLeft.row() - m_mapFirst, m_model->data(topLeft, Qt::DisplayRole).toDouble());
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 }
else
{
Marek Rosa
XYSeries: added support for limited mapping area
r734 // model update is relevant to BarSeries if the change was made to the part of the model that was mapped to BarSeries
if (topLeft.row() >= m_mapBarBottom && topLeft.row() <= m_mapBarTop && topLeft.column() >= m_mapFirst && topLeft.column() < m_mapFirst + m_mapCount)
barsetAt(topLeft.row() - m_mapBarBottom)->setValue(topLeft.column() - m_mapFirst, m_model->data(topLeft, Qt::DisplayRole).toDouble());
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 }
}
Marek Rosa
Added documentation for model related funtions
r900 /*!
\internal
*/
Marek Rosa
Adding data to BarSet through model added
r662 void QBarSeries::modelDataAdded(QModelIndex /*parent*/, int start, int /*end*/)
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 {
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 if (m_mapOrientation == Qt::Vertical) {
Marek Rosa
XYSeries: added support for limited mapping area
r734 insertCategory(start - m_mapFirst, QString("Row: %1").arg(start + 1));
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 for (int i = 0; i <= m_mapBarTop - m_mapBarBottom; i++) {
Marek Rosa
XYSeries: added support for limited mapping area
r734 barsetAt(i)->insertValue(start - m_mapFirst, m_model->data(m_model->index(start, i), Qt::DisplayRole).toDouble());
Marek Rosa
Adding data to BarSet through model added
r662 }
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 } else {
Marek Rosa
XYSeries: added support for limited mapping area
r734 insertCategory(start - m_mapFirst, QString("Column: %1").arg(start + 1));
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 for (int i = 0; i <= m_mapBarTop - m_mapBarBottom; i++) {
Marek Rosa
XYSeries: added support for limited mapping area
r734 barsetAt(i)->insertValue(start - m_mapFirst, m_model->data(m_model->index(i, start), Qt::DisplayRole).toDouble());
Marek Rosa
Adding data to BarSet through model added
r662 }
}
sauimone
percent barchart layout fix. signal fix
r850 emit restructuredBars();
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 }
Marek Rosa
Added documentation for model related funtions
r900 /*!
\internal
*/
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 void QBarSeries::modelDataRemoved(QModelIndex parent, int start, int end)
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 {
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 Q_UNUSED(parent)
Q_UNUSED(end)
Marek Rosa
XYSeries: added support for limited mapping area
r734 removeCategory(start - m_mapFirst);
Marek Rosa
Removing data from BarSeries through model added
r663 for (int i = 0; i <= m_mapBarTop - m_mapBarBottom; i++)
{
Marek Rosa
XYSeries: added support for limited mapping area
r734 barsetAt(i)->removeValue(start - m_mapFirst);
Marek Rosa
Removing data from BarSeries through model added
r663 }
sauimone
percent barchart layout fix. signal fix
r850 emit restructuredBars();
Marek Rosa
Added support for data from model to QBarSeries. Various fixes and small modifications to data from model support to other series
r630 }
void QBarSeries::barsetChanged()
Marek Rosa
QXYSeries: model data orientation added. QBarSeries: some model data function placeholders
r527 {
Marek Rosa
Barchart updates on BarSet->SetValue now
r655 emit updatedBars();
Marek Rosa
QXYSeries: model data orientation added. QBarSeries: some model data function placeholders
r527 }
Michal Klocek
Adds BarCategories typedef
r703 QBarCategories QBarSeries::categories() const
{
QBarCategories categories;
sauimone
minor code review fixes, part n
r763 int count = m_internalModel->categoryCount();
Tero Ahola
Code review: Fixed simple issues in Bar and Legend
r737 for (int i=1; i <= count; i++) {
sauimone
minor code review fixes, part n
r763 categories.insert(i, m_internalModel->categoryName(i - 1));
Michal Klocek
Adds BarCategories typedef
r703 }
return categories;
}
sauimone
fixed clipping in barcharts
r839 /*!
Sets the visibility of labels in series to \a visible
*/
sauimone
renamed barchart floating values with labels to be consistent with piechart
r820 void QBarSeries::setLabelsVisible(bool visible)
sauimone
values visibility handling changed in barchart
r813 {
foreach (QBarSet* s, barSets()) {
sauimone
renamed barchart floating values with labels to be consistent with piechart
r820 s->setLabelsVisible(visible);
sauimone
values visibility handling changed in barchart
r813 }
}
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 #include "moc_qbarseries.cpp"
sauimone
Improved bar chart series
r71
sauimone
Integrating bar chart. Cleaned up old implementation. TODO: show this in test application. how?
r56 QTCOMMERCIALCHART_END_NAMESPACE