mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
fix(dashboard): y-axis truncated incorrectly in certain value (#313)
* fix(dashboard): y-axis truncated incorrectly in certain value * Update Home.tsx
This commit is contained in:
parent
dece1c7098
commit
a8e91e9bc8
|
|
@ -150,8 +150,8 @@ const Home = () => {
|
|||
...(summary?.metrics_summary?.files ?? []),
|
||||
...(summary?.metrics_summary?.shares ?? []),
|
||||
];
|
||||
const yAxisUpperLimit = yAxisValue.length ? Math.max(...yAxisValue) : 0;
|
||||
const yAxisDigits = yAxisUpperLimit > 0 ? Math.floor(Math.log10(yAxisUpperLimit)) + 1 : 1;
|
||||
const yAxisUpperLimit = yAxisValue.length ? Math.max(...yAxisValue) / 0.8 - 1 : 0;
|
||||
const yAxisDigits = yAxisUpperLimit > 1 ? Math.floor(Math.log10(yAxisUpperLimit)) + 1 : 1;
|
||||
return 3 + yAxisDigits * 9;
|
||||
})()}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue