Changeset View
Changeset View
Standalone View
Standalone View
Modules/energy/package/contents/ui/main.qml
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Line(s) | 243 | Graph { | |||
---|---|---|---|---|---|
244 | id: graph | 244 | id: graph | ||
245 | Layout.fillWidth: true | 245 | Layout.fillWidth: true | ||
246 | Layout.minimumHeight: column.width / 3 | 246 | Layout.minimumHeight: column.width / 3 | ||
247 | Layout.maximumHeight: column.width / 3 | 247 | Layout.maximumHeight: column.width / 3 | ||
248 | Layout.topMargin: units.largeSpacing | 248 | Layout.topMargin: units.largeSpacing | ||
249 | 249 | | |||
250 | data: history.points | 250 | data: history.points | ||
251 | 251 | | |||
252 | readonly property var xDivisionWidths: [1000 * 60 * 5, 1000 * 60 * 15, 1000 * 60 * 60, | ||||
253 | 1000 * 60 * 60, 1000 * 60 * 60 * 2, 1000 * 60 * 60 * 12] | ||||
254 | readonly property real xTicksAtDontCare: 0 | ||||
255 | readonly property real xTicksAtTwelveOClock: 1 | ||||
256 | readonly property real xTicksAtFullHour: 2 | ||||
257 | readonly property real xTicksAtHalfHour: 3 | ||||
258 | readonly property real xTicksAtTenMinutes: 4 | ||||
259 | readonly property var xTicksAtList: [xTicksAtTenMinutes, xTicksAtHalfHour, xTicksAtHalfHour, | ||||
260 | xTicksAtHalfHour, xTicksAtFullHour, xTicksAtTwelveOClock] | ||||
261 | | ||||
262 | xDivisionWidth: xDivisionWidths[timespanCombo.currentIndex] | ||||
263 | xTicksAt: xTicksAtList[timespanCombo.currentIndex] | ||||
264 | | ||||
252 | xMin: history.firstDataPointTime | 265 | xMin: history.firstDataPointTime | ||
253 | xMax: history.lastDataPointTime | 266 | xMax: history.lastDataPointTime | ||
267 | xDuration: history.duration | ||||
254 | 268 | | |||
255 | yUnits: root.historyType == HistoryModel.RateType ? i18nc("Shorthand for Watts","W") : i18nc("literal percent sign","%") | 269 | yUnits: root.historyType == HistoryModel.RateType ? i18nc("Shorthand for Watts","W") : i18nc("literal percent sign","%") | ||
256 | yMax: { | 270 | yMax: { | ||
257 | if (root.historyType == HistoryModel.RateType) { | 271 | if (root.historyType == HistoryModel.RateType) { | ||
258 | var max = history.largestValue | 272 | var max = history.largestValue | ||
259 | var modulo = max % 10 | 273 | var modulo = max % 10 | ||
260 | if (modulo > 0) { | 274 | if (modulo > 0) { | ||
261 | max = max - modulo + 10 // ceil to nearest 10s | 275 | max = max - modulo + 10 // ceil to nearest 10s | ||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |