Skip to content

Commit d549b95

Browse files
authored
Merge pull request #1826 from appwrite/fix-show-legend-data-reads-writes-that-correspond-with-graph
Fix: Show the summation of the graph, not the totals
2 parents bd4a17d + 9391f10 commit d549b95

File tree

1 file changed

+14
-2
lines changed
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]

1 file changed

+14
-2
lines changed

src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,20 @@
3131
$: projects = (data.organizationUsage as OrganizationUsage).projects;
3232
3333
$: legendData = [
34-
{ name: 'Reads', value: data.organizationUsage.databasesReadsTotal },
35-
{ name: 'Writes', value: data.organizationUsage.databasesWritesTotal }
34+
{
35+
name: 'Reads',
36+
value: data.organizationUsage.databasesReads.reduce(
37+
(sum, singleDay) => sum + singleDay.value,
38+
0
39+
)
40+
},
41+
{
42+
name: 'Writes',
43+
value: data.organizationUsage.databasesWrites.reduce(
44+
(sum, singleDay) => sum + singleDay.value,
45+
0
46+
)
47+
}
3648
];
3749
</script>
3850

0 commit comments

Comments
 (0)