feat: graphs now properly sized + port static graphs to c++
This commit is contained in:
@@ -25,14 +25,6 @@ SnapLayout {
|
||||
return ZUtils.snap(d.getHours() + d.getMinutes() / 60, root);
|
||||
}
|
||||
|
||||
function formatHour(h) {
|
||||
if (root.useTwelveHourClock) {
|
||||
const hr = h % 12 === 0 ? 12 : h % 12;
|
||||
return hr + (h < 12 ? " AM" : " PM");
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 60000
|
||||
repeat: true
|
||||
@@ -78,8 +70,10 @@ SnapLayout {
|
||||
minHorizontalLines: 3
|
||||
yPaddingTop: horizontalLineStep
|
||||
yPaddingBottom: horizontalLineStep
|
||||
xLabel: i => root.formatHour(i)
|
||||
yLabel: v => Math.round(v) + "°"
|
||||
xLabelMode: LineGraph.Hour
|
||||
useTwelveHourClock: root.useTwelveHourClock
|
||||
yLabelMode: LineGraph.Value
|
||||
yLabelSuffix: "°"
|
||||
|
||||
markerX: root.markerX
|
||||
smoothing: root.smoothing
|
||||
@@ -133,8 +127,10 @@ SnapLayout {
|
||||
verticalLineStep: 3
|
||||
lastXLine: false
|
||||
horizontalLineStep: 30
|
||||
xLabel: i => root.formatHour(i)
|
||||
yLabel: v => v + "%"
|
||||
xLabelMode: LineGraph.Hour
|
||||
useTwelveHourClock: root.useTwelveHourClock
|
||||
yLabelMode: LineGraph.Value
|
||||
yLabelSuffix: "%"
|
||||
|
||||
markerX: root.markerX
|
||||
smoothing: root.smoothing
|
||||
|
||||
Reference in New Issue
Block a user