summaryrefslogtreecommitdiffstats
path: root/src/barchart/horizontal
diff options
context:
space:
mode:
Diffstat (limited to 'src/barchart/horizontal')
-rw-r--r--src/barchart/horizontal/bar/horizontalbarchartitem.cpp94
-rw-r--r--src/barchart/horizontal/bar/horizontalbarchartitem_p.h51
-rw-r--r--src/barchart/horizontal/bar/qhorizontalbarseries.cpp125
-rw-r--r--src/barchart/horizontal/bar/qhorizontalbarseries.h45
-rw-r--r--src/barchart/horizontal/bar/qhorizontalbarseries_p.h50
-rw-r--r--src/barchart/horizontal/percent/horizontalpercentbarchartitem.cpp140
-rw-r--r--src/barchart/horizontal/percent/horizontalpercentbarchartitem_p.h52
-rw-r--r--src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp124
-rw-r--r--src/barchart/horizontal/percent/qhorizontalpercentbarseries.h45
-rw-r--r--src/barchart/horizontal/percent/qhorizontalpercentbarseries_p.h50
-rw-r--r--src/barchart/horizontal/stacked/horizontalstackedbarchartitem.cpp107
-rw-r--r--src/barchart/horizontal/stacked/horizontalstackedbarchartitem_p.h51
-rw-r--r--src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp120
-rw-r--r--src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h45
-rw-r--r--src/barchart/horizontal/stacked/qhorizontalstackedbarseries_p.h50
15 files changed, 0 insertions, 1149 deletions
diff --git a/src/barchart/horizontal/bar/horizontalbarchartitem.cpp b/src/barchart/horizontal/bar/horizontalbarchartitem.cpp
deleted file mode 100644
index 6fc9e751..00000000
--- a/src/barchart/horizontal/bar/horizontalbarchartitem.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-#include "horizontalbarchartitem_p.h"
-#include "qabstractbarseries_p.h"
-#include "qbarset_p.h"
-#include "bar_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-HorizontalBarChartItem::HorizontalBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item)
- : AbstractBarChartItem(series, item)
-{
-}
-
-void HorizontalBarChartItem::initializeLayout()
-{
- qreal categoryCount = m_series->d_func()->categoryCount();
- qreal setCount = m_series->count();
- qreal barWidth = m_series->d_func()->barWidth();
-
- m_layout.clear();
- for(int category = 0; category < categoryCount; category++) {
- for (int set = 0; set < setCount; set++) {
- QRectF rect;
- QPointF topLeft;
- QPointF bottomRight;
- if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) {
- topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2 + set/setCount * barWidth), m_validData);
- bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2 + (set + 1)/setCount * barWidth), m_validData);
- } else {
- topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + set/setCount * barWidth), m_validData);
- bottomRight = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + (set + 1)/setCount * barWidth), m_validData);
- }
-
- if (!m_validData)
- return;
-
- rect.setTopLeft(topLeft);
- rect.setBottomRight(bottomRight);
- m_layout.append(rect.normalized());
- }
- }
-}
-
-QVector<QRectF> HorizontalBarChartItem::calculateLayout()
-{
- QVector<QRectF> layout;
-
- // Use temporary qreals for accuracy
- qreal categoryCount = m_series->d_func()->categoryCount();
- qreal setCount = m_series->count();
- qreal barWidth = m_series->d_func()->barWidth();
-
- for(int category = 0; category < categoryCount; category++) {
- for (int set = 0; set < setCount; set++) {
- qreal value = m_series->barSets().at(set)->at(category);
- QRectF rect;
- QPointF topLeft;
- if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain)
- topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2 + set/setCount * barWidth), m_validData);
- else
- topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2 + set/setCount * barWidth), m_validData);
-
- QPointF bottomRight = domain()->calculateGeometryPoint(QPointF(value, category - barWidth / 2 + (set + 1)/setCount * barWidth), m_validData);
-
- rect.setTopLeft(topLeft);
- rect.setBottomRight(bottomRight);
- layout.append(rect.normalized());
- }
- }
- return layout;
-}
-
-#include "moc_horizontalbarchartitem_p.cpp"
-
-QTCOMMERCIALCHART_END_NAMESPACE
diff --git a/src/barchart/horizontal/bar/horizontalbarchartitem_p.h b/src/barchart/horizontal/bar/horizontalbarchartitem_p.h
deleted file mode 100644
index 9991caa2..00000000
--- a/src/barchart/horizontal/bar/horizontalbarchartitem_p.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt Enterprise Chart API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#ifndef HORIZONTALBARCHARTITEM_H
-#define HORIZONTALBARCHARTITEM_H
-
-#include "abstractbarchartitem_p.h"
-#include <QGraphicsItem>
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class HorizontalBarChartItem : public AbstractBarChartItem
-{
- Q_OBJECT
-public:
- HorizontalBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0);
-
-private:
- virtual QVector<QRectF> calculateLayout();
- void initializeLayout();
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // HORIZONTALBARCHARTITEM_H
diff --git a/src/barchart/horizontal/bar/qhorizontalbarseries.cpp b/src/barchart/horizontal/bar/qhorizontalbarseries.cpp
deleted file mode 100644
index fdcfd6f9..00000000
--- a/src/barchart/horizontal/bar/qhorizontalbarseries.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-#include "qhorizontalbarseries.h"
-#include "qhorizontalbarseries_p.h"
-#include "horizontalbarchartitem_p.h"
-#include "qbarcategoryaxis.h"
-
-#include "chartdataset_p.h"
-#include "charttheme_p.h"
-
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-/*!
- \class QHorizontalBarSeries
- \inmodule Qt Charts
- \brief Series for creating horizontal bar chart.
- \mainclass
-
- QHorizontalBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
- as groups, where bars in same category are grouped next to each other. QHorizontalBarSeries groups the data
- from sets to categories, which are defined by a QStringList.
-
- See the \l {HorizontalBarChart Example} {horizontal bar chart example} to learn how to create a horizontal bar chart.
- \image examples_horizontalbarchart.png
-
- \sa QBarSet, QBarSeries, QPercentBarSeries, QAbstractBarSeries, QStackedBarSeries, QHorizontalStackedBarSeries, QHorizontalPercentBarSeries
-*/
-#ifdef QDOC_QT5
-/*!
- \qmltype HorizontalBarSeries
- \instantiates QHorizontalBarSeries
- \inqmlmodule QtCommercial.Chart
-
- \include doc/src/horizontalbarseries.qdocinc
-*/
-#else
-/*!
- \qmlclass HorizontalBarSeries QHorizontalBarSeries
-
- \include ../doc/src/horizontalbarseries.qdocinc
-*/
-#endif
-
-/*!
- Constructs empty QHorizontalBarSeries.
- QHorizontalBarSeries is QObject which is a child of a \a parent.
-*/
-QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent)
- : QAbstractBarSeries(*new QHorizontalBarSeriesPrivate(this), parent)
-{
-}
-
-/*!
- Destructor.
- Removes series from chart.
-*/
-QHorizontalBarSeries::~QHorizontalBarSeries()
-{
- Q_D(QHorizontalBarSeries);
- if (d->m_chart)
- d->m_chart->removeSeries(this);
-}
-
-/*!
- Returns QChartSeries::SeriesTypeHorizontalBar.
-*/
-QAbstractSeries::SeriesType QHorizontalBarSeries::type() const
-{
- return QAbstractSeries::SeriesTypeHorizontalBar;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-QHorizontalBarSeriesPrivate::QHorizontalBarSeriesPrivate(QHorizontalBarSeries *q)
- : QAbstractBarSeriesPrivate(q)
-{
-
-}
-
-void QHorizontalBarSeriesPrivate::initializeDomain()
-{
- qreal minX(domain()->minX());
- qreal minY(domain()->minY());
- qreal maxX(domain()->maxX());
- qreal maxY(domain()->maxY());
-
- qreal y = categoryCount();
- minX = qMin(minX, min());
- minY = qMin(minY, - (qreal)0.5);
- maxX = qMax(maxX, max());
- maxY = qMax(maxY, y - (qreal)0.5);
-
- domain()->setRange(minX, maxX, minY, maxY);
-}
-
-void QHorizontalBarSeriesPrivate::initializeGraphics(QGraphicsItem* parent)
-{
- Q_Q(QHorizontalBarSeries);
- HorizontalBarChartItem *bar = new HorizontalBarChartItem(q,parent);
- m_item.reset(bar);
- QAbstractSeriesPrivate::initializeGraphics(parent);
-}
-
-#include "moc_qhorizontalbarseries.cpp"
-
-QTCOMMERCIALCHART_END_NAMESPACE
diff --git a/src/barchart/horizontal/bar/qhorizontalbarseries.h b/src/barchart/horizontal/bar/qhorizontalbarseries.h
deleted file mode 100644
index 0631c05e..00000000
--- a/src/barchart/horizontal/bar/qhorizontalbarseries.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-#ifndef QHORIZONTALBARSERIES_H
-#define QHORIZONTALBARSERIES_H
-
-#include <qabstractbarseries.h>
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class QHorizontalBarSeriesPrivate;
-
-class QTCOMMERCIALCHART_EXPORT QHorizontalBarSeries : public QAbstractBarSeries
-{
- Q_OBJECT
-public:
- explicit QHorizontalBarSeries(QObject *parent = 0);
- ~QHorizontalBarSeries();
- QAbstractSeries::SeriesType type() const;
-
-private:
- Q_DECLARE_PRIVATE(QHorizontalBarSeries)
- Q_DISABLE_COPY(QHorizontalBarSeries)
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // QHORIZONTALBARSERIES_H
diff --git a/src/barchart/horizontal/bar/qhorizontalbarseries_p.h b/src/barchart/horizontal/bar/qhorizontalbarseries_p.h
deleted file mode 100644
index 9cafcca8..00000000
--- a/src/barchart/horizontal/bar/qhorizontalbarseries_p.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt Enterprise Chart API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#ifndef QHORIZONTALBARSERIES_P_H
-#define QHORIZONTALBARSERIES_P_H
-
-#include "qabstractbarseries_p.h"
-#include "abstractdomain_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class QHorizontalBarSeriesPrivate: public QAbstractBarSeriesPrivate
-{
-public:
- QHorizontalBarSeriesPrivate(QHorizontalBarSeries *q);
- void initializeGraphics(QGraphicsItem* parent);
- void initializeDomain();
-private:
- Q_DECLARE_PUBLIC(QHorizontalBarSeries)
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // QHORIZONTALBARSERIES_P_H
diff --git a/src/barchart/horizontal/percent/horizontalpercentbarchartitem.cpp b/src/barchart/horizontal/percent/horizontalpercentbarchartitem.cpp
deleted file mode 100644
index 9dd875dd..00000000
--- a/src/barchart/horizontal/percent/horizontalpercentbarchartitem.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-#include "horizontalpercentbarchartitem_p.h"
-#include "qabstractbarseries_p.h"
-#include "qbarset_p.h"
-#include "bar_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-HorizontalPercentBarChartItem::HorizontalPercentBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item)
- : AbstractBarChartItem(series, item)
-{
-}
-
-void HorizontalPercentBarChartItem::initializeLayout()
-{
- qreal categoryCount = m_series->d_func()->categoryCount();
- qreal setCount = m_series->count();
- qreal barWidth = m_series->d_func()->barWidth();
-
- m_layout.clear();
- for(int category = 0; category < categoryCount; category++) {
- for (int set = 0; set < setCount; set++) {
- QRectF rect;
- QPointF topLeft;
- QPointF bottomRight;
- if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) {
- topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2), m_validData);
- bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2), m_validData);
- } else {
- topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2), m_validData);
- bottomRight = domain()->calculateGeometryPoint(QPointF(0, category + barWidth / 2), m_validData);
- }
-
- if (!m_validData)
- return;
-
- rect.setTopLeft(topLeft);
- rect.setBottomRight(bottomRight);
- m_layout.append(rect.normalized());
- }
- }
-}
-
-QVector<QRectF> HorizontalPercentBarChartItem::calculateLayout()
-{
- QVector<QRectF> layout;
-
- // Use temporary qreals for accuracy
- qreal categoryCount = m_series->d_func()->categoryCount();
- qreal setCount = m_series->count();
- qreal barWidth = m_series->d_func()->barWidth();
-
- for(int category = 0; category < categoryCount; category++) {
- qreal sum = 0;
- qreal categorySum = m_series->d_func()->categorySum(category);
- for (int set = 0; set < setCount; set++) {
- qreal value = m_series->barSets().at(set)->at(category);
- QRectF rect;
- qreal topX = 0;
- if (sum > 0)
- topX = 100 * sum / categorySum;
- qreal bottomX = 0;
- qreal newSum = value + sum;
- if (newSum > 0)
- bottomX = 100 * newSum / categorySum;
- QPointF topLeft;
- if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain)
- topLeft = domain()->calculateGeometryPoint(QPointF(set ? topX : domain()->minX(), category - barWidth/2), m_validData);
- else
- topLeft = domain()->calculateGeometryPoint(QPointF(set ? topX : 0, category - barWidth/2), m_validData);
- QPointF bottomRight = domain()->calculateGeometryPoint(QPointF(bottomX, category + barWidth/2), m_validData);
-
- rect.setTopLeft(topLeft);
- rect.setBottomRight(bottomRight);
- layout.append(rect.normalized());
- sum = newSum;
- }
- }
- return layout;
-}
-
-void HorizontalPercentBarChartItem::handleUpdatedBars()
-{
- // Handle changes in pen, brush, labels etc.
- int categoryCount = m_series->d_func()->categoryCount();
- int setCount = m_series->count();
- int itemIndex(0);
- static const QString valueTag(QLatin1String("@value"));
-
- for (int category = 0; category < categoryCount; category++) {
- for (int set = 0; set < setCount; set++) {
- QBarSetPrivate *barSet = m_series->d_func()->barsetAt(set)->d_ptr.data();
- Bar *bar = m_bars.at(itemIndex);
- bar->setPen(barSet->m_pen);
- bar->setBrush(barSet->m_brush);
- bar->update();
-
- QGraphicsTextItem *label = m_labels.at(itemIndex);
- qreal p = m_series->d_func()->percentageAt(set, category) * 100.0;
- QString vString(presenter()->numberToString(p, 'f', 0));
- QString valueLabel;
- if (m_series->labelsFormat().isEmpty()) {
- vString.append("%");
- valueLabel = vString;
- } else {
- valueLabel = m_series->labelsFormat();
- valueLabel.replace(valueTag, vString);
- }
- label->setHtml(valueLabel);
- label->setFont(barSet->m_labelFont);
- label->setDefaultTextColor(barSet->m_labelBrush.color());
- label->update();
- itemIndex++;
- }
- }
-}
-
-#include "moc_horizontalpercentbarchartitem_p.cpp"
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
diff --git a/src/barchart/horizontal/percent/horizontalpercentbarchartitem_p.h b/src/barchart/horizontal/percent/horizontalpercentbarchartitem_p.h
deleted file mode 100644
index 5e313521..00000000
--- a/src/barchart/horizontal/percent/horizontalpercentbarchartitem_p.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt Enterprise Chart API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#ifndef HORIZONTALPERCENTBARCHARTITEM_P_H
-#define HORIZONTALPERCENTBARCHARTITEM_P_H
-
-#include "abstractbarchartitem_p.h"
-#include <QGraphicsItem>
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class HorizontalPercentBarChartItem : public AbstractBarChartItem
-{
- Q_OBJECT
-public:
- HorizontalPercentBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0);
- void handleUpdatedBars();
-
-private:
- virtual QVector<QRectF> calculateLayout();
- void initializeLayout();
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // HORIZONTALPERCENTBARCHARTITEM_P_H
diff --git a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp
deleted file mode 100644
index 846f77d4..00000000
--- a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-#include "qhorizontalpercentbarseries.h"
-#include "qhorizontalpercentbarseries_p.h"
-#include "horizontalpercentbarchartitem_p.h"
-
-#include "chartdataset_p.h"
-#include "charttheme_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-/*!
- \class QHorizontalPercentBarSeries
- \inmodule Qt Charts
- \brief Series for creating horizontal percent bar chart.
- \mainclass
-
- QHorizontalPercentBarSeries represents a series of data shown as bars. The purpose of this
- class is to draw bars as groups, where bars in same category are grouped next to each other.
- QHorizontalPercentBarSeries groups the data from sets to categories, which are defined by a
- QStringList. Bars with zero value are not drawn.
-
- See the \l {HorizontalPercentBarChart Example} {horizontal percent bar chart example} to learn
- how to create a horizontal percent bar chart.
- \image examples_horizontalpercentbarchart.png
-
- \sa QBarSet, QBarSeries, QPercentBarSeries, QAbstractBarSeries, QStackedBarSeries,
- QHorizontalStackedBarSeries, QHorizontalBarSeries
-*/
-#ifdef QDOC_QT5
-/*!
- \qmltype HorizontalPercentBarSeries
- \instantiates QHorizontalPercentBarSeries
- \inqmlmodule QtCommercial.Chart
-
- \include doc/src/horizontalpercentbarseries.qdocinc
-*/
-#else
-/*!
- \qmlclass HorizontalPercentBarSeries QHorizontalPercentBarSeries
-
- \include ../doc/src/horizontalpercentbarseries.qdocinc
-*/
-#endif
-
-/*!
- Constructs empty QHorizontalPercentBarSeries.
- QHorizontalPercentBarSeries is QObject which is a child of a \a parent.
-*/
-QHorizontalPercentBarSeries::QHorizontalPercentBarSeries(QObject *parent) :
- QAbstractBarSeries(*new QHorizontalPercentBarSeriesPrivate(this), parent)
-{
-}
-
-/*!
- Returns QAbstractSeries::SeriesTypeHorizontalPercentBar.
-*/
-QAbstractSeries::SeriesType QHorizontalPercentBarSeries::type() const
-{
- return QAbstractSeries::SeriesTypeHorizontalPercentBar;
-}
-
-/*!
- Destructor.
- Removes series from chart.
-*/
-QHorizontalPercentBarSeries::~QHorizontalPercentBarSeries()
-{
- Q_D(QHorizontalPercentBarSeries);
- if (d->m_chart)
- d->m_chart->removeSeries(this);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-QHorizontalPercentBarSeriesPrivate::QHorizontalPercentBarSeriesPrivate(QHorizontalPercentBarSeries *q) : QAbstractBarSeriesPrivate(q)
-{
-
-}
-
-void QHorizontalPercentBarSeriesPrivate::initializeDomain()
-{
- qreal minX(domain()->minX());
- qreal minY(domain()->minY());
- qreal maxX(domain()->maxX());
- qreal maxY(domain()->maxY());
-
- qreal y = categoryCount();
- minX = 0;
- maxX = 100;
- minY = qMin(minY, - (qreal)0.5);
- maxY = qMax(maxY, y - (qreal)0.5);
-
- domain()->setRange(minX, maxX, minY, maxY);
-}
-
-void QHorizontalPercentBarSeriesPrivate::initializeGraphics(QGraphicsItem* parent)
-{
- Q_Q(QHorizontalPercentBarSeries);
- HorizontalPercentBarChartItem *bar = new HorizontalPercentBarChartItem(q,parent);
- m_item.reset(bar);
- QAbstractSeriesPrivate::initializeGraphics(parent);
-}
-
-#include "moc_qhorizontalpercentbarseries.cpp"
-
-QTCOMMERCIALCHART_END_NAMESPACE
diff --git a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.h b/src/barchart/horizontal/percent/qhorizontalpercentbarseries.h
deleted file mode 100644
index 72ceb44e..00000000
--- a/src/barchart/horizontal/percent/qhorizontalpercentbarseries.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-#ifndef QHORIZONTALPERCENTBARSERIES_H
-#define QHORIZONTALPERCENTBARSERIES_H
-
-#include <qabstractbarseries.h>
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class QHorizontalPercentBarSeriesPrivate;
-
-class QTCOMMERCIALCHART_EXPORT QHorizontalPercentBarSeries : public QAbstractBarSeries
-{
- Q_OBJECT
-public:
- explicit QHorizontalPercentBarSeries(QObject *parent = 0);
- ~QHorizontalPercentBarSeries();
- QAbstractSeries::SeriesType type() const;
-
-private:
- Q_DECLARE_PRIVATE(QHorizontalPercentBarSeries)
- Q_DISABLE_COPY(QHorizontalPercentBarSeries)
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // QHORIZONTALPERCENTBARSERIES_H
diff --git a/src/barchart/horizontal/percent/qhorizontalpercentbarseries_p.h b/src/barchart/horizontal/percent/qhorizontalpercentbarseries_p.h
deleted file mode 100644
index 60de7425..00000000
--- a/src/barchart/horizontal/percent/qhorizontalpercentbarseries_p.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt Enterprise Chart API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#ifndef QHORIZONTALPERCENTBARSERIES_P_H
-#define QHORIZONTALPERCENTBARSERIES_P_H
-
-#include "qabstractbarseries_p.h"
-#include "abstractdomain_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class QHorizontalPercentBarSeriesPrivate: public QAbstractBarSeriesPrivate
-{
-public:
- QHorizontalPercentBarSeriesPrivate(QHorizontalPercentBarSeries *q);
- void initializeGraphics(QGraphicsItem* parent);
- void initializeDomain();
-private:
- Q_DECLARE_PUBLIC(QHorizontalPercentBarSeries)
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // QHORIZONTALPERCENTBARSERIES_P_H
diff --git a/src/barchart/horizontal/stacked/horizontalstackedbarchartitem.cpp b/src/barchart/horizontal/stacked/horizontalstackedbarchartitem.cpp
deleted file mode 100644
index ad80ec72..00000000
--- a/src/barchart/horizontal/stacked/horizontalstackedbarchartitem.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-#include "horizontalstackedbarchartitem_p.h"
-#include "qabstractbarseries_p.h"
-#include "qbarset_p.h"
-#include "bar_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-HorizontalStackedBarChartItem::HorizontalStackedBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item)
- : AbstractBarChartItem(series, item)
-{
-}
-
-void HorizontalStackedBarChartItem::initializeLayout()
-{
- qreal categoryCount = m_series->d_func()->categoryCount();
- qreal setCount = m_series->count();
- qreal barWidth = m_series->d_func()->barWidth();
-
- m_layout.clear();
- for(int category = 0; category < categoryCount; category++) {
- for (int set = 0; set < setCount; set++) {
- QRectF rect;
- QPointF topLeft;
- QPointF bottomRight;
- if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain) {
- topLeft = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category - barWidth / 2), m_validData);
- bottomRight = domain()->calculateGeometryPoint(QPointF(domain()->minX(), category + barWidth / 2), m_validData);
- } else {
- topLeft = domain()->calculateGeometryPoint(QPointF(0, category - barWidth / 2), m_validData);
- bottomRight = domain()->calculateGeometryPoint(QPointF(0, category + barWidth / 2), m_validData);
- }
-
- if (!m_validData)
- return;
-
- rect.setTopLeft(topLeft);
- rect.setBottomRight(bottomRight);
- m_layout.append(rect.normalized());
- }
- }
-}
-
-QVector<QRectF> HorizontalStackedBarChartItem::calculateLayout()
-{
- QVector<QRectF> layout;
-
- // Use temporary qreals for accuracy
- qreal categoryCount = m_series->d_func()->categoryCount();
- qreal setCount = m_series->count();
- qreal barWidth = m_series->d_func()->barWidth();
-
- for(int category = 0; category < categoryCount; category++) {
- qreal positiveSum = 0;
- qreal negativeSum = 0;
- for (int set = 0; set < setCount; set++) {
- qreal value = m_series->barSets().at(set)->at(category);
- QRectF rect;
- QPointF topLeft;
- QPointF bottomRight;
- if (value < 0) {
- bottomRight = domain()->calculateGeometryPoint(QPointF(value + negativeSum, category - barWidth / 2), m_validData);
- if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain)
- topLeft = domain()->calculateGeometryPoint(QPointF(set ? negativeSum : domain()->minX(), category + barWidth / 2), m_validData);
- else
- topLeft = domain()->calculateGeometryPoint(QPointF(set ? negativeSum : 0, category + barWidth / 2), m_validData);
- negativeSum += value;
- } else {
- bottomRight = domain()->calculateGeometryPoint(QPointF(value + positiveSum, category - barWidth / 2), m_validData);
- if (domain()->type() == AbstractDomain::LogXYDomain || domain()->type() == AbstractDomain::LogXLogYDomain)
- topLeft = domain()->calculateGeometryPoint(QPointF(set ? positiveSum : domain()->minX(), category + barWidth / 2), m_validData);
- else
- topLeft = domain()->calculateGeometryPoint(QPointF(set ? positiveSum : 0, category + barWidth / 2), m_validData);
- positiveSum += value;
- }
-
- rect.setTopLeft(topLeft);
- rect.setBottomRight(bottomRight);
- layout.append(rect.normalized());
- }
- }
- return layout;
-}
-
-#include "moc_horizontalstackedbarchartitem_p.cpp"
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
diff --git a/src/barchart/horizontal/stacked/horizontalstackedbarchartitem_p.h b/src/barchart/horizontal/stacked/horizontalstackedbarchartitem_p.h
deleted file mode 100644
index 4e91a8b3..00000000
--- a/src/barchart/horizontal/stacked/horizontalstackedbarchartitem_p.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt Enterprise Chart API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#ifndef HORIZONTALSTACKEDBARCHARTITEM_P_H
-#define HORIZONTALSTACKEDBARCHARTITEM_P_H
-
-#include "abstractbarchartitem_p.h"
-#include <QGraphicsItem>
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class HorizontalStackedBarChartItem : public AbstractBarChartItem
-{
- Q_OBJECT
-public:
- HorizontalStackedBarChartItem(QAbstractBarSeries *series, QGraphicsItem* item = 0);
-
-private:
- virtual QVector<QRectF> calculateLayout();
- void initializeLayout();
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // HORIZONTALSTACKEDBARCHARTITEM_P_H
diff --git a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp
deleted file mode 100644
index a5d8f519..00000000
--- a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-#include "qhorizontalstackedbarseries.h"
-#include "qhorizontalstackedbarseries_p.h"
-#include "horizontalstackedbarchartitem_p.h"
-
-#include "chartdataset_p.h"
-#include "charttheme_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-/*!
- \class QHorizontalStackedBarSeries
- \inmodule Qt Charts
- \brief Series for creating horizontal stacked bar chart.
- \mainclass
-
- QHorizontalStackedBarSeries represents a series of data shown as bars. The purpose of this class is to draw bars
- as groups, where bars in same category are grouped next to each other. QHorizontalStackedBarSeries groups the data
- from sets to categories, which are defined by a QStringList.
-
- See the \l {HorizontalStackedBarChart Example} {horizontal stacked bar chart example} to learn how to create a horizontal stacked bar chart.
- \image examples_horizontalstackedbarchart.png
-
- \sa QBarSet, QBarSeries, QPercentBarSeries, QAbstractBarSeries, QStackedBarSeries, QHorizontalPercentBarSeries, QHorizontalBarSeries
-*/
-#ifdef QDOC_QT5
-/*!
- \qmltype HorizontalStackedBarSeries
- \instantiates QHorizontalStackedBarSeries
- \inqmlmodule QtCommercial.Chart
-
- \include doc/src/horizontalstackedbarseries.qdocinc
-*/
-#else
-/*!
- \qmlclass HorizontalStackedBarSeries QHorizontalStackedBarSeries
-
- \include ../doc/src/horizontalstackedbarseries.qdocinc
-*/
-#endif
-
-/*!
- Constructs empty QHorizontalStackedBarSeries.
- QHorizontalStackedBarSeries is QObject which is a child of a \a parent.
-*/
-QHorizontalStackedBarSeries::QHorizontalStackedBarSeries(QObject *parent)
- : QAbstractBarSeries(*new QHorizontalStackedBarSeriesPrivate(this), parent)
-{
-}
-
-/*!
- Destructor.
- Removes series from chart.
-*/
-QHorizontalStackedBarSeries::~QHorizontalStackedBarSeries()
-{
- Q_D(QHorizontalStackedBarSeries);
- if (d->m_chart)
- d->m_chart->removeSeries(this);
-}
-
-/*!
- Returns QAbstractSeries::SeriesTypeHorizontalStackedBar.
-*/
-QAbstractSeries::SeriesType QHorizontalStackedBarSeries::type() const
-{
- return QAbstractSeries::SeriesTypeHorizontalStackedBar;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-QHorizontalStackedBarSeriesPrivate::QHorizontalStackedBarSeriesPrivate(QHorizontalStackedBarSeries *q) : QAbstractBarSeriesPrivate(q)
-{
-
-}
-
-void QHorizontalStackedBarSeriesPrivate::initializeDomain()
-{
- qreal minX(domain()->minX());
- qreal minY(domain()->minY());
- qreal maxX(domain()->maxX());
- qreal maxY(domain()->maxY());
-
- qreal y = categoryCount();
- minX = qMin(minX, bottom());
- minY = qMin(minY, - (qreal)0.5);
- maxX = qMax(maxX, top());
- maxY = qMax(maxY, y - (qreal)0.5);
-
- domain()->setRange(minX, maxX, minY, maxY);
-}
-
-void QHorizontalStackedBarSeriesPrivate::initializeGraphics(QGraphicsItem *parent)
-{
- Q_Q(QHorizontalStackedBarSeries);
- HorizontalStackedBarChartItem *bar = new HorizontalStackedBarChartItem(q,parent);
- m_item.reset(bar);
- QAbstractSeriesPrivate::initializeGraphics(parent);
-}
-
-#include "moc_qhorizontalstackedbarseries.cpp"
-
-QTCOMMERCIALCHART_END_NAMESPACE
diff --git a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h
deleted file mode 100644
index 5db21851..00000000
--- a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-#ifndef QHORIZONTALSTACKEDBARSERIES_H
-#define QHORIZONTALSTACKEDBARSERIES_H
-
-#include <qabstractbarseries.h>
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class QHorizontalStackedBarSeriesPrivate;
-
-class QTCOMMERCIALCHART_EXPORT QHorizontalStackedBarSeries : public QAbstractBarSeries
-{
- Q_OBJECT
-public:
- explicit QHorizontalStackedBarSeries(QObject *parent = 0);
- ~QHorizontalStackedBarSeries();
- QAbstractSeries::SeriesType type() const;
-
-private:
- Q_DECLARE_PRIVATE(QHorizontalStackedBarSeries)
- Q_DISABLE_COPY(QHorizontalStackedBarSeries)
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // QHORIZONTALSTACKEDBARSERIES_H
diff --git a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries_p.h b/src/barchart/horizontal/stacked/qhorizontalstackedbarseries_p.h
deleted file mode 100644
index 869cf593..00000000
--- a/src/barchart/horizontal/stacked/qhorizontalstackedbarseries_p.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 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 Enterprise Charts Add-on.
-**
-** $QT_BEGIN_LICENSE$
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise 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$
-**
-****************************************************************************/
-
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt Enterprise Chart API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
-#ifndef QHORIZONTALSTACKEDBARSERIES_P_H
-#define QHORIZONTALSTACKEDBARSERIES_P_H
-
-#include "qabstractbarseries_p.h"
-#include "abstractdomain_p.h"
-
-QTCOMMERCIALCHART_BEGIN_NAMESPACE
-
-class QHorizontalStackedBarSeriesPrivate: public QAbstractBarSeriesPrivate
-{
-public:
- QHorizontalStackedBarSeriesPrivate(QHorizontalStackedBarSeries *q);
- void initializeGraphics(QGraphicsItem* parent);
- void initializeDomain();
-private:
- Q_DECLARE_PUBLIC(QHorizontalStackedBarSeries)
-};
-
-QTCOMMERCIALCHART_END_NAMESPACE
-
-#endif // QHORIZONTALSTACKEDBARSERIES_P_H