aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/content/StockModel.qml
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-05-27 13:18:00 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-11 14:44:46 +0200
commit56c534ace6ab26fadd616f477be1ec51b93332b6 (patch)
tree9c8715e69a92416b01b8c302ed67be3077066969 /examples/quick/demos/stocqt/content/StockModel.qml
parent906cf6ce32604dc71d3e5b33f2de2f0046e252ff (diff)
Further improve the StocQt demo
- Display the price scale on y-axis, highest trade volume on x-axis - Adjust grid size for the chart based on the active view - Fix incorrect drawing of volume data - Correctly scale the chart based on the price/volume ranges - Align the volume graph to the price chart and improve its look - Use Date.toDateString() instead of hardcoded month names - Minor fixes to layout Task-number: QTBUG-38254 Change-Id: I0e7ef18a152c7678371fb9c01f86d3d91a289472 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'examples/quick/demos/stocqt/content/StockModel.qml')
-rw-r--r--examples/quick/demos/stocqt/content/StockModel.qml12
1 files changed, 1 insertions, 11 deletions
diff --git a/examples/quick/demos/stocqt/content/StockModel.qml b/examples/quick/demos/stocqt/content/StockModel.qml
index 682c96bb53..e3ae600aa0 100644
--- a/examples/quick/demos/stocqt/content/StockModel.qml
+++ b/examples/quick/demos/stocqt/content/StockModel.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
@@ -48,8 +48,6 @@ ListModel {
property bool ready: false
property real stockPrice: 0.0
property real stockPriceChanged: 0.0
- property real highestPrice: 0
- property real highestVolume: 0
signal dataReady
@@ -111,10 +109,6 @@ ListModel {
}
function createStockPrice(r) {
- if (highestPrice < r[2])
- highestPrice = r[2];
- if (highestVolume < r[5])
- highestVolume = r[5];
return {
"date": r[0],
"open":r[1],
@@ -138,10 +132,6 @@ ListModel {
model.ready = false;
model.clear();
-
- highestPrice = 0;
- highestVolume = 0;
-
var i = 1; //skip the first line
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.LOADING || xhr.readyState === XMLHttpRequest.DONE) {