summaryrefslogtreecommitdiffstats
path: root/examples/spectrum
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2013-08-07 14:52:28 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-08-08 08:21:37 +0300
commitebee290095f9a32dbcf5956e9fed50d2610cbfe1 (patch)
treec9260232aa82517c12bbcd94ef3d004b29860959 /examples/spectrum
parentb3e10fcc8403bc1a0d9d4c107b52eb10af0ecffa (diff)
Tickcount and both automatic and explicit range setting via axes
- Tick count moved to QValueAxis. - QValueAxis adjusts range to data by default on barcharts. - QValueaxis explicit range setting now works for barchart. Change-Id: I2c0afcab34b74a848144fda41d9135dcdb510354 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/spectrum')
-rw-r--r--examples/spectrum/spectrumapp/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/spectrum/spectrumapp/main.cpp b/examples/spectrum/spectrumapp/main.cpp
index 11f89bc3..583d8ad4 100644
--- a/examples/spectrum/spectrumapp/main.cpp
+++ b/examples/spectrum/spectrumapp/main.cpp
@@ -42,6 +42,7 @@
#include "engine.h"
#include "utils.h"
#include "qbardataproxy.h"
+#include "qvalueaxis.h"
#include <QGuiApplication>
#include <QAudio>
@@ -89,9 +90,10 @@ MainApp::MainApp(Q3DBars *window)
m_chart->setupSampleSpace(SpectrumNumBands * 2, SpectrumNumBands);
// Disable grid
m_chart->setGridVisible(false);
- // Disable auto-scaling of height by defining tick count and step, even though we don't draw grid
- // By setting count to 1 and step to the max we can get, we lock the scale of the bars.
- m_chart->setTickCount(1, 1.0f);
+ // Disable auto-scaling of height by defining explicit range
+ // By setting count to 0 we avoid getting any grid
+ m_chart->valueAxis()->setTickCount(0);
+ m_chart->valueAxis()->setRange(0.0, 1.0);
// Disable shadows
m_chart->setShadowQuality(ShadowNone);
#if USE_CONES