##// END OF EJS Templates
Added option to set labels clipping...
Added option to set labels clipping It's now possible to enable and disable the point label clipping. The clipping is enabled by default. Clipping cuts the point labels on the edge of the plot area. Change-Id: Ifaa6017b4c6d55fe030effeec8b336a7fc317adf Task-number: QTRD-3520 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>

File last commit:

r2782:5fbd172ba15f
r2815:4c1d3bc34edb
Show More
qstackedbarseries.cpp
120 lines | 3.5 KiB | text/x-c | CppLexer
Jani Honkonen
Add license headers
r794 /****************************************************************************
**
Titta Heikkala
Copyright header changes...
r2776 ** Copyright (C) 2015 The Qt Company Ltd
Jani Honkonen
Add license headers
r794 ** All rights reserved.
Titta Heikkala
Copyright header changes...
r2776 ** For any questions to The Qt Company, please use contact form at http://qt.io
Jani Honkonen
Add license headers
r794 **
Titta Heikkala
Updated license headers...
r2740 ** This file is part of the Qt Charts module.
Jani Honkonen
Add license headers
r794 **
Titta Heikkala
Updated license headers...
r2740 ** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
Titta Heikkala
Copyright header changes...
r2776 ** agreement between you and The Qt Company.
Jani Honkonen
Add license headers
r794 **
** If you have questions regarding the use of this file, please use
Titta Heikkala
Updated license headers...
r2740 ** contact form at http://qt.io
Jani Honkonen
Add license headers
r794 **
****************************************************************************/
Titta Heikkala
Fix include syntax...
r2714 #include <QtCharts/QStackedBarSeries>
#include <private/qstackedbarseries_p.h>
#include <private/stackedbarchartitem_p.h>
#include <private/chartdataset_p.h>
#include <private/charttheme_p.h>
#include <QtCharts/QValueAxis>
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_BEGIN_NAMESPACE
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338
/*!
\class QStackedBarSeries
Titta Heikkala
Fix Charts documentation...
r2639 \inmodule Qt Charts
Miikka Heikkinen
Fix some documentation issues...
r2520 \brief Series for creating stacked bar chart.
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338
sauimone
Fixed category handling of barcharts. Now the categories can be undefined. Updated documentation.
r1208 QStackedBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
as stacks, where bars in same category are stacked on top of each other.
sauimone
replaced qbarcategory with qstringlist
r377 QStackedBarSeries groups the data from sets to categories, which are defined by QStringList.
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338
Tero Ahola
Documentation fixes....
r995 See the \l {StackedbarChart Example} {stacked bar chart example} to learn how to create a stacked bar chart.
\image examples_stackedbarchart.png
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338
sauimone
renamed barseries files to abstractbarseries
r1586 \sa QBarSet, QPercentBarSeries, QAbstractBarSeries
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 */
Titta Heikkala
Fix Charts documentation...
r2639 /*!
\qmltype StackedBarSeries
\instantiates QStackedBarSeries
Titta Heikkala
Qt Charts project file structure change...
r2712 \inqmlmodule QtCharts
Titta Heikkala
Fix Charts documentation...
r2639
Titta Heikkala
Qt Charts project file structure change...
r2712 \inherits AbstractBarSeries
\brief Series for creating stacked bar chart.
Tero Ahola
Documenting QML bar series API
r1489
Titta Heikkala
Qt Charts project file structure change...
r2712 The following QML shows how to create a simple stacked bar chart:
\snippet qmlchart/qml/qmlchart/View7.qml 1
\beginfloatleft
\image examples_qmlchart7.png
\endfloat
\clearfloat
Tero Ahola
Documenting QML bar series API
r1489 */
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 /*!
sauimone
Fixed category handling of barcharts. Now the categories can be undefined. Updated documentation.
r1208 Constructs empty QStackedBarSeries.
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 QStackedBarSeries is QObject which is a child of a \a parent.
*/
sauimone
Fixed category handling of barcharts. Now the categories can be undefined. Updated documentation.
r1208 QStackedBarSeries::QStackedBarSeries(QObject *parent)
sauimone
QBarSeries to QAbstractBarSeries
r1584 : QAbstractBarSeries(*new QStackedBarSeriesPrivate(this), parent)
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 {
}
sauimone
fixed warnings from barchart docs
r1850 /*!
Destructor. Removes series from chart.
*/
Michal Klocek
Fixes wrong bar destruction by adding destructor for bar*series , note this breaks ABI
r1727 QStackedBarSeries::~QStackedBarSeries()
{
Q_D(QStackedBarSeries);
Michal Klocek
Refactors internals...
r2273 if (d->m_chart)
d->m_chart->removeSeries(this);
Michal Klocek
Fixes wrong bar destruction by adding destructor for bar*series , note this breaks ABI
r1727 }
Jani Honkonen
Fix series type() docs
r1345 /*!
Miikka Heikkinen
Fix some documentation issues...
r2520 Returns QAbstractSeries::SeriesTypeStackedBar.
Jani Honkonen
Fix series type() docs
r1345 */
Michal Klocek
Fixes to API , QSeriesType -> SeriesType , add missing getters
r1107 QAbstractSeries::SeriesType QStackedBarSeries::type() const
Michal Klocek
Adds big fat pimpl to series classes...
r938 {
Tero Ahola
Renamed QSeries to QAbstractSeries
r988 return QAbstractSeries::SeriesTypeStackedBar;
Michal Klocek
Adds big fat pimpl to series classes...
r938 }
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
sauimone
QBarSeries to QAbstractBarSeries
r1584 QStackedBarSeriesPrivate::QStackedBarSeriesPrivate(QStackedBarSeries *q) : QAbstractBarSeriesPrivate(q)
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943 {
}
Michal Klocek
Refactors internals...
r2273 void QStackedBarSeriesPrivate::initializeDomain()
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943 {
Michal Klocek
Refactors internals...
r2273 qreal minX(domain()->minX());
qreal minY(domain()->minY());
qreal maxX(domain()->maxX());
qreal maxY(domain()->maxY());
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943
sauimone
removed categories from barseries. categories are now only on axis
r1321 qreal x = categoryCount();
Marek Rosa
Added casting to qreal in qMin, qFuzzyCompare calls to fix build on arm
r1679 minX = qMin(minX, - (qreal)0.5);
sauimone
Better support for negative values in stacked barcharts. Negative values are stacked from zero to negative direction. Positive values are stacked from zero to positive direction.
r1897 minY = qMin(minY, bottom());
Marek Rosa
Added casting to qreal in qMin, qFuzzyCompare calls to fix build on arm
r1679 maxX = qMax(maxX, x - (qreal)0.5);
sauimone
Better support for negative values in stacked barcharts. Negative values are stacked from zero to negative direction. Positive values are stacked from zero to positive direction.
r1897 maxY = qMax(maxY, top());
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943
Michal Klocek
Refactors internals...
r2273 domain()->setRange(minX, maxX, minY, maxY);
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943 }
Michal Klocek
Refactors internals...
r2273 void QStackedBarSeriesPrivate::initializeGraphics(QGraphicsItem* parent)
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943 {
Q_Q(QStackedBarSeries);
Michal Klocek
Refactors internals...
r2273 StackedBarChartItem *bar = new StackedBarChartItem(q,parent);
m_item.reset(bar);
QAbstractSeriesPrivate::initializeGraphics(parent);
}
Michal Klocek
Refactor to use qseries private for implmentation interface...
r943
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338 #include "moc_qstackedbarseries.cpp"
Titta Heikkala
Qt Charts project file structure change...
r2712 QT_CHARTS_END_NAMESPACE
sauimone
Naming convention change for barcharts. QBarChartSeries is now QBarSeries etc.
r338