summaryrefslogtreecommitdiffstats
path: root/examples/customproxy/rainfallgraph.cpp
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@digia.com>2013-12-18 11:50:03 +0200
committerMika Salmela <mika.salmela@digia.com>2013-12-18 11:51:20 +0200
commit07aba602fc82ac31684988f8e8e22521d2b3c982 (patch)
tree7ae1da139e8661bf157f996fe71844031d2995f4 /examples/customproxy/rainfallgraph.cpp
parentcf0cf6ca67aec8ae480bb705443ea17f5ab9f9e2 (diff)
parentea0442bc81ae034d22c5742b6075dee993fdd54d (diff)
Merge branch 'develop' into mergebranch
Conflicts: examples/qmlbars/qml/qmlbars/main.qml examples/qmlscatter/qml/qmlscatter/main.qml examples/qmlsurface/qml/qmlsurface/main.qml src/datavisualization/data/qitemmodelbardatamapping.cpp src/datavisualization/data/qitemmodelscatterdatamapping.cpp src/datavisualization/data/qitemmodelsurfacedatamapping.cpp src/datavisualization/engine/drawer.cpp Change-Id: I731ebdb2cc5cee8f2cb32becee96d1fc1b3e5de1
Diffstat (limited to 'examples/customproxy/rainfallgraph.cpp')
-rw-r--r--examples/customproxy/rainfallgraph.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/examples/customproxy/rainfallgraph.cpp b/examples/customproxy/rainfallgraph.cpp
index 3a9f820a..ad45d016 100644
--- a/examples/customproxy/rainfallgraph.cpp
+++ b/examples/customproxy/rainfallgraph.cpp
@@ -21,6 +21,8 @@
#include <QtDataVisualization/q3dvalueaxis.h>
#include <QtDataVisualization/q3dscene.h>
#include <QtDataVisualization/q3dcamera.h>
+#include <QtDataVisualization/qbar3dseries.h>
+#include <QtDataVisualization/q3dtheme.h>
#include <QGuiApplication>
#include <QFont>
#include <QDebug>
@@ -39,13 +41,14 @@ RainfallGraph::RainfallGraph(Q3DBars *rainfall)
m_columnCount = m_numericMonths.size();
m_proxy = new VariantBarDataProxy;
- m_graph->setActiveDataProxy(m_proxy);
+ QBar3DSeries *series = new QBar3DSeries(m_proxy);
+ m_graph->addSeries(series);
updateYearsList(2000, 2012);
// Set up bar specifications; make the bars as wide as they are deep,
// and add a small space between the bars
- m_graph->setBarThickness(1.0);
+ m_graph->setBarThickness(1.0f);
m_graph->setBarSpacing(QSizeF(0.2, 0.2));
// Set axis labels and titles
@@ -56,26 +59,26 @@ RainfallGraph::RainfallGraph(Q3DBars *rainfall)
m_graph->valueAxis()->setTitle("rainfall");
m_graph->valueAxis()->setLabelFormat("%d mm");
m_graph->valueAxis()->setSegmentCount(5);
- m_graph->rowAxis()->setCategoryLabels(m_years);
- m_graph->columnAxis()->setCategoryLabels(months);
+ m_graph->rowAxis()->setLabels(m_years);
+ m_graph->columnAxis()->setLabels(months);
// Set bar type to cylinder
- m_graph->setBarType(QDataVis::MeshStyleCylinders, false);
+ series->setMesh(QAbstract3DSeries::MeshCylinder);
// Set shadows to medium
m_graph->setShadowQuality(QDataVis::ShadowQualityMedium);
- // Set font
- m_graph->setFont(QFont("Century Gothic", 30));
-
// Set selection mode to bar and column
- m_graph->setSelectionMode(QDataVis::SelectionModeSliceColumn);
+ m_graph->setSelectionMode(QDataVis::SelectionItemAndColumn | QDataVis::SelectionSlice);
// Set theme
- m_graph->setTheme(QDataVis::ThemeArmyBlue);
+ m_graph->setTheme(new Q3DTheme(Q3DTheme::ThemeArmyBlue));
+
+ // Set font to theme
+ m_graph->theme()->setFont(QFont("Century Gothic", 30));
// Set camera position and zoom
- m_graph->scene()->activeCamera()->setCameraPreset(QDataVis::CameraPresetIsometricRightHigh);
+ m_graph->scene()->activeCamera()->setCameraPreset(Q3DCamera::CameraPresetIsometricRightHigh);
m_graph->scene()->activeCamera()->setZoomLevel(75);
// Set window title