Changeset View
Changeset View
Standalone View
Standalone View
Modules/energy/package/contents/ui/main.qml
Show First 20 Lines • Show All 287 Lines • ▼ Show 20 Line(s) | 265 | Graph { | |||
---|---|---|---|---|---|
288 | xMin: history.firstDataPointTime | 288 | xMin: history.firstDataPointTime | ||
289 | xMax: history.lastDataPointTime | 289 | xMax: history.lastDataPointTime | ||
290 | xDuration: history.duration | 290 | xDuration: history.duration | ||
291 | 291 | | |||
292 | yUnits: root.historyType == HistoryModel.RateType ? i18nc("Shorthand for Watts","W") : i18nc("literal percent sign","%") | 292 | yUnits: root.historyType == HistoryModel.RateType ? i18nc("Shorthand for Watts","W") : i18nc("literal percent sign","%") | ||
293 | yMax: { | 293 | yMax: { | ||
294 | if (root.historyType == HistoryModel.RateType) { | 294 | if (root.historyType == HistoryModel.RateType) { | ||
295 | // ceil to nearest 10 | 295 | // ceil to nearest 10 | ||
296 | return Math.floor(history.largestValue) + 10 | 296 | var max = Math.floor(history.largestValue) | ||
297 | max = max - max % 10 + 10 | ||||
298 | | ||||
299 | return max; | ||||
297 | } else { | 300 | } else { | ||
298 | return 100; | 301 | return 100; | ||
299 | } | 302 | } | ||
300 | } | 303 | } | ||
301 | yStep: root.historyType == HistoryModel.RateType ? 10 : 20 | 304 | yStep: root.historyType == HistoryModel.RateType ? 10 : 20 | ||
302 | visible: history.count > 1 | 305 | visible: history.count > 1 | ||
303 | } | 306 | } | ||
304 | 307 | | |||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |