summaryrefslogtreecommitdiffstats
path: root/src/barchart/horizontal/bar
diff options
context:
space:
mode:
Diffstat (limited to 'src/barchart/horizontal/bar')
-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
5 files changed, 0 insertions, 365 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