summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Wincenciak <jakub@scythe-studio.com>2023-10-23 15:05:43 +0200
committerJakub Wincenciak <jakub@scythe-studio.com>2023-10-23 17:33:09 +0200
commitcd46e5b5be1e4f6c658bb441868981025fb0dda3 (patch)
tree84a21da994dc0c25ca6d193c19803fcccfa33951
parentd79d15a1adb91b2a613b43339a750c87a64c2756 (diff)
Fix 'Too many arguments' runtime error in qml wheather example app
BarSet item used for the rainfall charts used the append() function which takes one argument not two, so I removed the unnecessary one. I also added the missing scaling of the second Y axis for rainfall data. Fixes: QTBUG-115274 Pick-to: 6.6 Change-Id: I4a0337fed28c77619fa14f45aac94877a5e3d30c Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--examples/charts/qmlweather/qml/qmlweather/main.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/charts/qmlweather/qml/qmlweather/main.qml b/examples/charts/qmlweather/qml/qmlweather/main.qml
index f783ce80..0de1dec7 100644
--- a/examples/charts/qmlweather/qml/qmlweather/main.qml
+++ b/examples/charts/qmlweather/qml/qmlweather/main.qml
@@ -163,12 +163,13 @@ Rectangle {
// synchronized with the rainfall bars.
maxTempSeries.append(Number(i) + 0.5, weatherObj.tempMaxC);
minTempSeries.append(Number(i) + 0.5, weatherObj.tempMinC);
- rainfallSet.append(i, weatherObj.precipMM);
+ rainfallSet.append(weatherObj.precipMM);
weatherImageModel.append({"imageSource":weatherObj.weatherIconUrl[0].value});
//![5]
// Update scale of the chart
- valueAxisY.max = Math.max(chartView.axisY().max,weatherObj.tempMaxC);
+ valueAxisY.max = Math.max(chartView.axisY().max, weatherObj.tempMaxC);
+ valueAxisY2.max = Math.max(valueAxisY2.max, weatherObj.precipMM);
valueAxisX.min = 0;
valueAxisX.max = Number(i) + 1;