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
This commit is contained in:
Steven Nguyen
2025-04-30 14:31:43 -07:00
committed by GitHub
@@ -31,8 +31,20 @@
$: projects = (data.organizationUsage as OrganizationUsage).projects;
$: legendData = [
{ name: 'Reads', value: data.organizationUsage.databasesReadsTotal },
{ name: 'Writes', value: data.organizationUsage.databasesWritesTotal }
{
name: 'Reads',
value: data.organizationUsage.databasesReads.reduce(
(sum, singleDay) => sum + singleDay.value,
0
)
},
{
name: 'Writes',
value: data.organizationUsage.databasesWrites.reduce(
(sum, singleDay) => sum + singleDay.value,
0
)
}
];
</script>