##// END OF EJS Templates
Checkbox for anti-alias to chartwidgettest
Checkbox for anti-alias to chartwidgettest

File last commit:

r377:a61a7697be62
r379:ef3b0565576e
Show More
qbarseries.cpp
230 lines | 4.9 KiB | text/x-c | CppLexer
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"
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
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 \fn void QBarSeries::changed(int index)
sauimone
Updated barchart documentation
r319 \brief \internal \a index
sauimone
Documentation for bar charts
r313 */
/*!
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 \fn void QBarSeries::floatingValuesEnabled(bool enabled)
sauimone
Updated barchart documentation
r319 \brief \internal \a enabled
sauimone
Documentation for bar charts
r313 */
/*!
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 \fn void QBarSeries::toolTipEnabled(bool enabled)
sauimone
Updated barchart documentation
r319 \brief \internal \a enabled
sauimone
Documentation for bar charts
r313 */
/*!
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 \fn void QBarSeries::separatorsEnabled(bool enabled)
sauimone
Updated barchart documentation
r319 \brief \internal \a enabled
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
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 Constructs empty QBarSeries. Parameter \a category defines the categories for chart.
QBarSeries is QObject which is a child of a \a parent.
sauimone
Documentation for bar charts
r313 */
sauimone
replaced qbarcategory with qstringlist
r377 QBarSeries::QBarSeries(QStringList categories, QObject *parent)
Michal Klocek
Rename QChartSeries to QSeries
r360 : QSeries(parent)
sauimone
replaced qbarcategory with qstringlist
r377 ,mModel(new BarChartModel(categories, this))
sauimone
Improved bar chart series
r71 {
}
sauimone
Documentation for bar charts
r313 /*!
Adds a set of bars to series. Takes ownership of \a set
*/
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 void QBarSeries::addBarSet(QBarSet *set)
sauimone
Barset and barcategory implememtation. Updated test application
r171 {
sauimone
removed barchartseriesbase. functionality is now in model
r172 mModel->addBarSet(set);
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
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
removed barchartseriesbase. functionality is now in model
r172 mModel->removeBarSet(set);
}
sauimone
Documentation for bar charts
r313 /*!
Returns number of sets in series.
*/
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 int QBarSeries::barsetCount()
sauimone
Added pen & brush to QBarSet
r214 {
return mModel->countSets();
}
sauimone
exposing countcategories to user from barchartseries
r323 /*!
Returns number of categories in series
*/
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 int QBarSeries::categoryCount()
sauimone
exposing countcategories to user from barchartseries
r323 {
return mModel->countCategories();
}
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.
*/
QList<QBarSet*> QBarSeries::barSets()
sauimone
Added pen & brush to QBarSet
r214 {
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 return mModel->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 {
return mModel->setAt(index);
}
sauimone
Documentation for bar charts
r313 /*!
Returns legend of series. Legend is a list of set names in series.
*/
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 QList<QString> QBarSeries::legend()
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 {
return mModel->legend();
}
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 QString QBarSeries::label(int category)
sauimone
moved tooltip to presenter
r288 {
return mModel->label(category);
}
sauimone
Documentation for bar charts
r313 /*!
Enables or disables floating values depending on parameter \a enabled.
Floating values are bar values, that are displayed on top of each bar.
Calling without parameter \a enabled, enables the floating values
*/
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 void QBarSeries::setFloatingValuesEnabled(bool enabled)
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 {
sauimone
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296 if (enabled) {
for (int i=0; i<mModel->countSets(); i++) {
QBarSet *set = mModel->setAt(i);
connect(set,SIGNAL(clicked()),set,SIGNAL(toggleFloatingValues()));
}
} else {
for (int i=0; i<mModel->countSets(); i++) {
QBarSet *set = mModel->setAt(i);
disconnect(set,SIGNAL(clicked()),set,SIGNAL(toggleFloatingValues()));
}
}
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 }
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
enablers for tooltip and floating values, bug fixing, updated examples. tidying up the code
r296 if (enabled) {
for (int i=0; i<mModel->countSets(); i++) {
QBarSet *set = mModel->setAt(i);
connect(set,SIGNAL(showToolTip(QPoint,QString)),this,SIGNAL(showToolTip(QPoint,QString)));
}
} else {
for (int i=0; i<mModel->countSets(); i++) {
QBarSet *set = mModel->setAt(i);
disconnect(set,SIGNAL(showToolTip(QPoint,QString)),this,SIGNAL(showToolTip(QPoint,QString)));
}
}
sauimone
moved tooltip to presenter
r288 }
sauimone
Documentation for bar charts
r313 /*!
Enables or disables separators depending on parameter \a enabled.
Separators are visual elements that are drawn between categories.
Calling without parameter \a enabled, enables the separators
*/
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 void QBarSeries::setSeparatorsEnabled(bool enabled)
sauimone
moved tooltip to presenter
r288 {
emit separatorsEnabled(enabled);
sauimone
barcharts: added legend to model. added signals for hover events (for tooltip). updated examples
r280 }
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 {
return mModel->min();
}
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 {
return mModel->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 {
return mModel->valueAt(set,category);
}
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 {
return mModel->percentageAt(set,category);
}
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 {
return mModel->categorySum(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 {
return mModel->maxCategorySum();
}
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 BarChartModel& QBarSeries::model()
sauimone
removed barchartseriesbase. functionality is now in model
r172 {
return *mModel;
}
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