@@ -0,0 +1,19 | |||||
|
1 | #include "horizontalbarchartitem_p.h" | |||
|
2 | ||||
|
3 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
4 | ||||
|
5 | HorizontalBarChartitem::HorizontalBarChartitem(QAbstractBarSeries *series, ChartPresenter *presenter) : | |||
|
6 | BarChartItem(series, presenter) | |||
|
7 | { | |||
|
8 | } | |||
|
9 | ||||
|
10 | QVector<QRectF> HorizontalBarChartitem::calculateLayout() | |||
|
11 | { | |||
|
12 | // TODO: | |||
|
13 | QVector<QRectF> layout; | |||
|
14 | return layout; | |||
|
15 | } | |||
|
16 | ||||
|
17 | #include "moc_horizontalbarchartitem_p.cpp" | |||
|
18 | ||||
|
19 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -0,0 +1,23 | |||||
|
1 | #ifndef HORIZONTALBARCHARTITEM_H | |||
|
2 | #define HORIZONTALBARCHARTITEM_H | |||
|
3 | ||||
|
4 | #include "barchartitem_p.h" | |||
|
5 | #include "qstackedbarseries.h" | |||
|
6 | #include <QGraphicsItem> | |||
|
7 | ||||
|
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
9 | ||||
|
10 | ||||
|
11 | class HorizontalBarChartitem : public BarChartItem | |||
|
12 | { | |||
|
13 | Q_OBJECT | |||
|
14 | public: | |||
|
15 | HorizontalBarChartitem(QAbstractBarSeries *series, ChartPresenter *presenter); | |||
|
16 | ||||
|
17 | private: | |||
|
18 | virtual QVector<QRectF> calculateLayout(); | |||
|
19 | }; | |||
|
20 | ||||
|
21 | QTCOMMERCIALCHART_END_NAMESPACE | |||
|
22 | ||||
|
23 | #endif // HORIZONTALBARCHARTITEM_H |
@@ -0,0 +1,69 | |||||
|
1 | #include "qhorizontalbarseries.h" | |||
|
2 | #include "qhorizontalbarseries_p.h" | |||
|
3 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
4 | ||||
|
5 | QHorizontalBarSeries::QHorizontalBarSeries(QObject *parent) : | |||
|
6 | QAbstractBarSeries(parent) | |||
|
7 | { | |||
|
8 | } | |||
|
9 | ||||
|
10 | QAbstractSeries::SeriesType QHorizontalBarSeries::type() const | |||
|
11 | { | |||
|
12 | return QAbstractSeries::SeriesTypeHorizontalBar; | |||
|
13 | } | |||
|
14 | ||||
|
15 | ||||
|
16 | ||||
|
17 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
|
18 | ||||
|
19 | QHorizontalBarSeriesPrivate::QHorizontalBarSeriesPrivate(QHorizontalBarSeries *q) : QAbstractBarSeriesPrivate(q) | |||
|
20 | { | |||
|
21 | ||||
|
22 | } | |||
|
23 | ||||
|
24 | void QHorizontalBarSeriesPrivate::scaleDomain(Domain& domain) | |||
|
25 | { | |||
|
26 | // TODO: | |||
|
27 | Q_UNUSED(domain); | |||
|
28 | /* | |||
|
29 | qreal minX(domain.minX()); | |||
|
30 | qreal minY(domain.minY()); | |||
|
31 | qreal maxX(domain.maxX()); | |||
|
32 | qreal maxY(domain.maxY()); | |||
|
33 | int tickXCount(domain.tickXCount()); | |||
|
34 | int tickYCount(domain.tickYCount()); | |||
|
35 | ||||
|
36 | qreal x = categoryCount(); | |||
|
37 | qreal y = max(); | |||
|
38 | minX = qMin(minX, -0.5); | |||
|
39 | minY = qMin(minY, y); | |||
|
40 | maxX = qMax(maxX, x - 0.5); | |||
|
41 | maxY = qMax(maxY, y); | |||
|
42 | tickXCount = x+1; | |||
|
43 | ||||
|
44 | domain.setRange(minX,maxX,minY,maxY,tickXCount,tickYCount); | |||
|
45 | */ | |||
|
46 | } | |||
|
47 | ||||
|
48 | ||||
|
49 | Chart* QHorizontalBarSeriesPrivate::createGraphics(ChartPresenter* presenter) | |||
|
50 | { | |||
|
51 | // TODO: | |||
|
52 | Q_UNUSED(presenter); | |||
|
53 | return 0; | |||
|
54 | /* | |||
|
55 | Q_Q(QHorizontalBarSeries); | |||
|
56 | ||||
|
57 | GroupedBarChartItem* bar = new GroupedBarChartItem(q,presenter); | |||
|
58 | if(presenter->animationOptions().testFlag(QChart::SeriesAnimations)) { | |||
|
59 | presenter->animator()->addAnimation(bar); | |||
|
60 | } | |||
|
61 | presenter->chartTheme()->decorate(q, presenter->dataSet()->seriesIndex(q)); | |||
|
62 | return bar; | |||
|
63 | */ | |||
|
64 | } | |||
|
65 | ||||
|
66 | ||||
|
67 | #include "moc_qhorizontalbarseries.cpp" | |||
|
68 | ||||
|
69 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -0,0 +1,24 | |||||
|
1 | #ifndef QHORIZONTALBARSERIES_H | |||
|
2 | #define QHORIZONTALBARSERIES_H | |||
|
3 | ||||
|
4 | #include <qabstractbarseries.h> | |||
|
5 | ||||
|
6 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
7 | ||||
|
8 | class QHorizontalBarSeriesPrivate; | |||
|
9 | ||||
|
10 | class QTCOMMERCIALCHART_EXPORT QHorizontalBarSeries : public QAbstractBarSeries | |||
|
11 | { | |||
|
12 | Q_OBJECT | |||
|
13 | public: | |||
|
14 | explicit QHorizontalBarSeries(QObject *parent = 0); | |||
|
15 | QAbstractSeries::SeriesType type() const; | |||
|
16 | ||||
|
17 | private: | |||
|
18 | Q_DECLARE_PRIVATE(QHorizontalBarSeries) | |||
|
19 | Q_DISABLE_COPY(QHorizontalBarSeries) | |||
|
20 | }; | |||
|
21 | ||||
|
22 | QTCOMMERCIALCHART_END_NAMESPACE | |||
|
23 | ||||
|
24 | #endif // QHORIZONTALBARSERIES_H |
@@ -0,0 +1,51 | |||||
|
1 | /**************************************************************************** | |||
|
2 | ** | |||
|
3 | ** Copyright (C) 2012 Digia Plc | |||
|
4 | ** All rights reserved. | |||
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |||
|
6 | ** | |||
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |||
|
8 | ** | |||
|
9 | ** $QT_BEGIN_LICENSE$ | |||
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |||
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |||
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |||
|
13 | ** a written agreement between you and Digia. | |||
|
14 | ** | |||
|
15 | ** If you have questions regarding the use of this file, please use | |||
|
16 | ** contact form at http://qt.digia.com | |||
|
17 | ** $QT_END_LICENSE$ | |||
|
18 | ** | |||
|
19 | ****************************************************************************/ | |||
|
20 | ||||
|
21 | // W A R N I N G | |||
|
22 | // ------------- | |||
|
23 | // | |||
|
24 | // This file is not part of the QtCommercial Chart API. It exists purely as an | |||
|
25 | // implementation detail. This header file may change from version to | |||
|
26 | // version without notice, or even be removed. | |||
|
27 | // | |||
|
28 | // We mean it. | |||
|
29 | ||||
|
30 | #ifndef QHORIZONTALBARSERIES_P_H | |||
|
31 | #define QHORIZONTALBARSERIES_P_H | |||
|
32 | ||||
|
33 | #include "qabstractbarseries_p.h" | |||
|
34 | #include "domain_p.h" | |||
|
35 | ||||
|
36 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
37 | ||||
|
38 | class QHorizontalBarSeriesPrivate: public QAbstractBarSeriesPrivate | |||
|
39 | { | |||
|
40 | public: | |||
|
41 | QHorizontalBarSeriesPrivate(QHorizontalBarSeries* q); | |||
|
42 | Chart* createGraphics(ChartPresenter* presenter); | |||
|
43 | void scaleDomain(Domain& domain); | |||
|
44 | ||||
|
45 | private: | |||
|
46 | Q_DECLARE_PUBLIC(QHorizontalBarSeries) | |||
|
47 | }; | |||
|
48 | ||||
|
49 | QTCOMMERCIALCHART_END_NAMESPACE | |||
|
50 | ||||
|
51 | #endif // QHORIZONTALBARSERIES_P_H |
@@ -14,7 +14,9 SOURCES += \ | |||||
14 | $$PWD/stackedbarchartitem.cpp \ |
|
14 | $$PWD/stackedbarchartitem.cpp \ | |
15 | $$PWD/qbarmodelmapper.cpp \ |
|
15 | $$PWD/qbarmodelmapper.cpp \ | |
16 | $$PWD/qvbarmodelmapper.cpp \ |
|
16 | $$PWD/qvbarmodelmapper.cpp \ | |
17 | $$PWD/qhbarmodelmapper.cpp |
|
17 | $$PWD/qhbarmodelmapper.cpp \ | |
|
18 | $$PWD/qhorizontalbarseries.cpp \ | |||
|
19 | $$PWD/horizontalbarchartitem.cpp | |||
18 |
|
20 | |||
19 | PRIVATE_HEADERS += \ |
|
21 | PRIVATE_HEADERS += \ | |
20 | $$PWD/bar_p.h \ |
|
22 | $$PWD/bar_p.h \ | |
@@ -27,7 +29,9 PRIVATE_HEADERS += \ | |||||
27 | $$PWD/qstackedbarseries_p.h\ |
|
29 | $$PWD/qstackedbarseries_p.h\ | |
28 | $$PWD/qpercentbarseries_p.h \ |
|
30 | $$PWD/qpercentbarseries_p.h \ | |
29 | $$PWD/qbarseries_p.h \ |
|
31 | $$PWD/qbarseries_p.h \ | |
30 | $$PWD/qbarmodelmapper_p.h |
|
32 | $$PWD/qbarmodelmapper_p.h \ | |
|
33 | $$PWD/qhorizontalbarseries_p.h \ | |||
|
34 | $$PWD/horizontalbarchartitem_p.h | |||
31 |
|
35 | |||
32 | PUBLIC_HEADERS += \ |
|
36 | PUBLIC_HEADERS += \ | |
33 | $$PWD/qabstractbarseries.h \ |
|
37 | $$PWD/qabstractbarseries.h \ | |
@@ -37,4 +41,5 PUBLIC_HEADERS += \ | |||||
37 | $$PWD/qbarseries.h \ |
|
41 | $$PWD/qbarseries.h \ | |
38 | $$PWD/qbarmodelmapper.h \ |
|
42 | $$PWD/qbarmodelmapper.h \ | |
39 | $$PWD/qvbarmodelmapper.h \ |
|
43 | $$PWD/qvbarmodelmapper.h \ | |
40 | $$PWD/qhbarmodelmapper.h |
|
44 | $$PWD/qhbarmodelmapper.h \ | |
|
45 | $$PWD/qhorizontalbarseries.h |
General Comments 0
You need to be logged in to leave comments.
Login now