[WIFI-12226] Interface stats Y-axis now only 2 decimals or less

Signed-off-by: Charles <charles.bourque96@gmail.com>
This commit is contained in:
Charles
2023-01-27 10:37:08 +01:00
parent 1cfd3a10ad
commit 7a254e343e
3 changed files with 18 additions and 18 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.9.0(3)", "version": "2.9.0(4)",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.9.0(3)", "version": "2.9.0(4)",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@chakra-ui/icons": "^2.0.11", "@chakra-ui/icons": "^2.0.11",

View File

@@ -1,6 +1,6 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.9.0(3)", "version": "2.9.0(4)",
"description": "", "description": "",
"private": true, "private": true,
"main": "index.tsx", "main": "index.tsx",

View File

@@ -45,21 +45,21 @@ const InterfaceChart = ({ data }: Props) => {
const points = { const points = {
labels: data.recorded.map((recorded) => new Date(recorded * 1000).toLocaleTimeString()), labels: data.recorded.map((recorded) => new Date(recorded * 1000).toLocaleTimeString()),
datasets: [ datasets: [
{ {
// Real 'Tx', but shown as 'Rx' // Real 'Tx', but shown as 'Rx'
label: 'Tx', label: 'Tx',
data: data.rx.map((tx) => Math.floor((tx / factor) * 100) / 100), data: data.rx.map((tx) => (Math.floor((tx / factor) * 100) / 100).toFixed(2)),
borderColor: colorMode === 'light' ? '#63B3ED' : '#BEE3F8', // blue-300 - blue-100 borderColor: colorMode === 'light' ? '#63B3ED' : '#BEE3F8', // blue-300 - blue-100
backgroundColor: colorMode === 'light' ? '#63B3ED' : '#BEE3F8', // blue-300 - blue-100 backgroundColor: colorMode === 'light' ? '#63B3ED' : '#BEE3F8', // blue-300 - blue-100
}, },
{ {
// Real 'Rx', but shown as 'Tx' // Real 'Rx', but shown as 'Tx'
label: 'Rx', label: 'Rx',
data: data.tx.map((rx) => Math.floor((rx / factor) * 100) / 100), data: data.tx.map((rx) => (Math.floor((rx / factor) * 100) / 100).toFixed(2)),
borderColor: colorMode === 'light' ? '#48BB78' : '#9AE6B4', // green-400 - green-200 borderColor: colorMode === 'light' ? '#48BB78' : '#9AE6B4', // green-400 - green-200
backgroundColor: colorMode === 'light' ? '#48BB78' : '#9AE6B4', // green-400 - green-200 backgroundColor: colorMode === 'light' ? '#48BB78' : '#9AE6B4', // green-400 - green-200
}, },
], ],
}; };
return ( return (