Skip to content

Commit

Permalink
web/satellite: fix errant chart unit
Browse files Browse the repository at this point in the history
This change fixes an issue where the charts on the dashboard will show
a wrong unit (PB). This was due to there not being usage for a
particular time period.

Change-Id: I8f126c229ef2cbb65419ac670a49957cfcf6c62b
  • Loading branch information
wilfred-asomanii authored and mobyvb committed Dec 18, 2023
1 parent 8b53066 commit 8c312b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -413,7 +413,8 @@ function recalculateChartWidth(): void {
* Returns dimension for given data values.
*/
function getDimension(dataStamps: DataStamp[]): Dimensions {
const maxValue = Math.max(...dataStamps.map(s => s.value));
const filteredData = dataStamps.filter(s => !!s);
const maxValue = Math.max(...filteredData.map(s => s.value));
return new Size(maxValue).label;
}
Expand Down
3 changes: 2 additions & 1 deletion web/satellite/vuetify-poc/src/views/Dashboard.vue
Expand Up @@ -543,7 +543,8 @@ function recalculateChartWidth(): void {
* Returns dimension for given data values.
*/
function getDimension(dataStamps: DataStamp[]): Dimensions {
const maxValue = Math.max(...dataStamps.map(s => s.value));
const filteredData = dataStamps.filter(s => !!s);
const maxValue = Math.max(...filteredData.map(s => s.value));
return new Size(maxValue).label;
}
Expand Down

1 comment on commit 8c312b0

@storjrobot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Storj Community Forum (official). There might be relevant details there:

https://forum.storj.io/t/bug-in-storage-and-download-graphs/24781/2

Please sign in to comment.