diff options
author | Jakub Wincenciak <jakub@scythe-studio.com> | 2023-10-23 15:05:43 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-10-29 12:50:16 +0000 |
commit | abd020b325e07f48d19ac97b7c37cabc8b81d6f4 (patch) | |
tree | e79fe7134b2c9988aa5a6b7b33115871ce2bcc13 | |
parent | 04f26f0f4455c40c7d55aa91a7c474632e89cb15 (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
Change-Id: I4a0337fed28c77619fa14f45aac94877a5e3d30c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
(cherry picked from commit cd46e5b5be1e4f6c658bb441868981025fb0dda3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/charts/qmlweather/qml/qmlweather/main.qml | 5 |
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; |