Skip to content

Commit 3bb0a8f

Browse files
samsharafrozenhelium
authored andcommitted
Fix pie chart start angle and ordering(largest to smallest)
1 parent 18ca794 commit 3bb0a8f

File tree

1 file changed

+4
-2
lines changed
  • community-dashboard/app/views/StatsBoard

1 file changed

+4
-2
lines changed

community-dashboard/app/views/StatsBoard/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ function StatsBoard(props: Props) {
364364
...item,
365365
projectType: item.projectType ?? '-1',
366366
}))
367-
.sort((a, b) => compareNumber(b.totalSwipes, a.totalSwipes)) ?? []
367+
.sort((a, b) => compareNumber(a.totalSwipes, b.totalSwipes)) ?? []
368368
),
369369
[swipeByProjectType],
370370
);
@@ -382,7 +382,7 @@ function StatsBoard(props: Props) {
382382
organizationName: item.organizationName ?? 'Unknown',
383383
}))
384384
.filter((project) => isDefined(project.organizationName))
385-
.sort((a, b) => compareNumber(b.totalSwipes, a.totalSwipes)) ?? [];
385+
.sort((a, b) => compareNumber(a.totalSwipes, b.totalSwipes)) ?? [];
386386

387387
if (sortedTotalSwipeByOrganization.length <= 5) {
388388
return sortedTotalSwipeByOrganization;
@@ -722,6 +722,7 @@ function StatsBoard(props: Props) {
722722
cy="50%"
723723
outerRadius="90%"
724724
innerRadius="50%"
725+
startAngle={-270}
725726
>
726727
{sortedProjectSwipeType.map((item) => (
727728
<Cell
@@ -765,6 +766,7 @@ function StatsBoard(props: Props) {
765766
cy="50%"
766767
outerRadius="90%"
767768
innerRadius="50%"
769+
startAngle={-270}
768770
>
769771
{totalSwipesByOrganizationStats.map((item) => (
770772
<Cell

0 commit comments

Comments
 (0)