Skip to content

Commit b40dcac

Browse files
authored
Merge pull request #363 from AppQuality/fix-pie-legend
fix(widgetusecase): Remove indexes from legend
2 parents c19787b + e735069 commit b40dcac

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/pages/Campaign/widgets/UniqueBugs4UseCase/Chart/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ export const ChartUniqueBugs4UseCase = ({
4444
),
4545
value: total.toString(),
4646
}}
47+
labelFormatter={({ labelPosition, data, id, label }) => {
48+
if (labelPosition === 'arclink' && label) return label.toString();
49+
if (labelPosition === 'legend' && data?.fullName)
50+
return data.fullName.toString();
51+
return id.toString();
52+
}}
4753
data={newItems}
4854
theme={{ labels: { text: { fontSize: 10 } } }}
4955
tooltip={({ label, value }) => (

src/pages/Campaign/widgets/UniqueBugs4UseCase/useBugsByUsecase.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const useBugsByUsecase = (campaignId: string) => {
5353
setItems(
5454
data.data.map((item, index) => ({
5555
id: getArcLinkLabel(item.title) + index,
56+
fullName: getArcLinkLabel(item.title),
5657
label: getLegendLabel(item.title),
5758
value: item.bugs,
5859
key: item.usecase_id,

0 commit comments

Comments
 (0)