Skip to content

Commit

Permalink
Merge pull request #1726 from appwrite/fix-usage-bucket-chart
Browse files Browse the repository at this point in the history
fix: add option to usage bucket chart to be cumulative
  • Loading branch information
ItzNotABug authored Mar 6, 2025
2 parents e800b0b + bf82c9f commit 7f322dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/layout/usage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
export let countMetadata: MetricMetadata;
export let path: string = null;
export let hideSelectPeriod: boolean = false;
export let isCumulative: boolean = false;
</script>

<Container>
Expand Down Expand Up @@ -118,7 +119,9 @@
series={[
{
name: countMetadata.legend,
data: accumulateFromEndingTotal(count, total)
data: isCumulative
? count.map((m) => [m.date, m.value])
: accumulateFromEndingTotal(count, total)
}
]} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
legend: 'Image transformations',
title: 'Total transformations'
}}
isCumulative
hideSelectPeriod />

0 comments on commit 7f322dc

Please sign in to comment.