Skip to content

Commit 036bdca

Browse files
committed
update
1 parent f85b3c4 commit 036bdca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dashboard2/src/components/DeviceMetrics.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ const MetricGraph = ({ name } : { name: string }) => {
6969
const draw = (state: AppState) => {
7070
const { width, height } = canvas;
7171
const { buckets, minValue, maxValue } = state[dataKey] as MetricData;
72-
7372
const range = maxValue - minValue;
7473

7574
const ctx = canvas.getContext('2d')!;
@@ -87,6 +86,13 @@ const MetricGraph = ({ name } : { name: string }) => {
8786
return;
8887
}
8988

89+
// Hour lines
90+
const hourInterval = Math.round(width / 24);
91+
for (let x = 0; x < 24; x += 3) {
92+
ctx.fillStyle = (x % 6 === 0) ? Theme.palette.grey5 : Theme.palette.grey2;
93+
ctx.fillRect(x * hourInterval, 0, 1, height);
94+
}
95+
9096
// Latest data
9197
const points = buckets.length > width ? buckets.slice(buckets.length - width) : buckets;
9298
let minPoint: PlotPoint = { x: 0, y: 0, value: 0 };

0 commit comments

Comments
 (0)