mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
feat: adjust CPU chart canvas height and update value formatting for better readability
This commit is contained in:
@@ -412,7 +412,7 @@ switch ($themeHelper->getThemeName()) { // $themeHelper set in DefaultPageLayout
|
||||
?>
|
||||
<tr id='cpu_chart'>
|
||||
<td>
|
||||
<canvas id='cpuchart' style='width:100%; height:120px'></canvas>
|
||||
<canvas id='cpuchart' style='width:100%; height:96px'></canvas>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -1447,7 +1447,7 @@ function getMillisPerPixel(timeInSeconds, containerId) {
|
||||
// SmoothieCharts initialization
|
||||
var cpuchart = new SmoothieChart({
|
||||
millisPerPixel: (cpuline * 1000) / 600, // Safe initial value
|
||||
minValue: 0,
|
||||
minValue: -1,
|
||||
maxValue: 100,
|
||||
responsive: true,
|
||||
grid: {
|
||||
@@ -1466,10 +1466,10 @@ var cpuchart = new SmoothieChart({
|
||||
minValueScale: 1.02,
|
||||
maxValueScale: 1.02,
|
||||
yMinFormatter: function(value) {
|
||||
return Math.max(0, Math.floor(value));
|
||||
return Math.max(0, Math.floor(value)) + ' %';
|
||||
},
|
||||
yMaxFormatter: function(value) {
|
||||
return Math.floor(value);
|
||||
return Math.max(0, Math.min(100, Math.ceil(value))) + ' %';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user