graphs: fix cpu graphs

This commit is contained in:
Girish Ramakrishnan
2025-05-20 15:37:20 +02:00
parent 8bcff36745
commit 64cb966683
3 changed files with 12 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ async function refresh() {
if (error) return console.error(error);
const labels = result.cpu.map(v => {
return moment(v[1]*1000).format('hh:mm:ss');
return moment(v[1]*1000).format('hh:mm');
});
const data = result.cpu.map(v => {

View File

@@ -17,7 +17,7 @@ async function refresh() {
if (error) return console.error(error);
const labels = result.memory.map(v => {
return moment(v[1]*1000).format('hh:mm:ss');
return moment(v[1]*1000).format('hh:mm');
});
const data = result.memory.map(v => {
@@ -48,13 +48,15 @@ async function refresh() {
ticks: { autoSkipPadding: 50, maxRotation: 0 }
},
y: {
ticks: { maxTicksLimit: 6 },
ticks: {
callback: (value) => {
return `${value} GiB`;
},
maxTicksLimit: 6
},
min: 0,
max: roundedMemoryGiB,
beginAtZero: true,
callback: (value) => {
return (value/1024).toLocaleString('en-US', { maximumFractionDigits: 6 }) + ' GiB';
}
}
},
interaction: {