Skip to content

Commit 5a4f5ed

Browse files
committed
Update formatter
1 parent 456490f commit 5a4f5ed

File tree

4 files changed

+27
-18
lines changed

4 files changed

+27
-18
lines changed

TestingArena/ArenaVueUiChestnut.vue

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,16 +333,17 @@ const config = computed(() => {
333333
...c.style.chart.layout,
334334
grandTotal: {
335335
...c.style.chart.layout.grandTotal,
336-
formatter: (val) => {
337-
return `tot - ${val}`
336+
formatter: ({value}) => {
337+
return `tot - ${value}`
338338
}
339339
},
340340
roots: {
341341
...c.style.chart.layout.roots,
342342
labels: {
343343
...c.style.chart.layout.roots.labels,
344-
formatter: (val) => {
345-
return `root - ${val}`
344+
formatter: ({value, config }) => {
345+
// console.log({config})
346+
return `root - ${value}`
346347
}
347348
}
348349
},
@@ -352,8 +353,8 @@ const config = computed(() => {
352353
...c.style.chart.layout.branches.labels,
353354
dataLabels: {
354355
...c.style.chart.layout.branches.labels.dataLabels,
355-
formatter: (val) => {
356-
return `branch - ${val}`
356+
formatter: ({value}) => {
357+
return `branch - ${value}`
357358
}
358359
}
359360
}
@@ -366,8 +367,8 @@ const config = computed(() => {
366367
...c.style.chart.layout.nuts.selected.labels,
367368
dataLabels: {
368369
...c.style.chart.layout.nuts.selected.labels.dataLabels,
369-
formatter: (val) => {
370-
return `nut - ${val}`
370+
formatter: ({value}) => {
371+
return `nut - ${value}`
371372
}
372373
}
373374
}

TestingArena/ArenaVueUiTiremarks.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ const config = computed(() => {
7373
...c.style.chart,
7474
percentage: {
7575
...c.style.chart.percentage,
76-
formatter: (val) => {
77-
return `f - ${val}`
76+
formatter: ({value}) => {
77+
return `f - ${value}`
7878
}
7979
}
8080
}

TestingArena/ArenaVueUiWheel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ const config = computed(() => {
7171
...c.style.chart.layout,
7272
percentage: {
7373
...c.style.chart.layout.percentage,
74-
formatter: (val) => {
75-
return `f - ${val}`
74+
formatter: ({value}) => {
75+
return `f - ${value}`
7676
}
7777
}
7878
}

src/components/vue-ui-chestnut.vue

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,9 @@ defineExpose({
707707
v: root.total,
708708
s: FINAL_CONFIG.style.chart.layout.roots.labels.suffix,
709709
r: FINAL_CONFIG.style.chart.layout.roots.labels.roundingValue
710-
}))
710+
}),
711+
{ datapoint: root }
712+
)
711713
}}
712714
</text>
713715
<!-- ROOT NAME LABEL -->
@@ -777,7 +779,9 @@ defineExpose({
777779
v: branch.value,
778780
s: FINAL_CONFIG.style.chart.layout.branches.labels.dataLabels.suffix,
779781
r: FINAL_CONFIG.style.chart.layout.branches.labels.dataLabels.roundingValue
780-
}))
782+
}),
783+
{ datapoint: branch }
784+
)
781785
}}
782786
</text>
783787
</g>
@@ -876,7 +880,8 @@ defineExpose({
876880
v: root.total,
877881
s: FINAL_CONFIG.style.chart.layout.legend.suffix,
878882
r: FINAL_CONFIG.style.chart.layout.legend.roundingValue
879-
})
883+
}),
884+
{ datapoint: root }
880885
) }}
881886
</b>
882887
({{ dataLabel({
@@ -999,7 +1004,8 @@ defineExpose({
9991004
v: selectedNut.value,
10001005
s: FINAL_CONFIG.style.chart.layout.nuts.selected.labels.core.value.suffix,
10011006
r: FINAL_CONFIG.style.chart.layout.nuts.selected.roundingValue
1002-
})
1007+
}),
1008+
{ datapoint: selectedNut }
10031009
) }}
10041010
</text>
10051011

@@ -1057,7 +1063,8 @@ defineExpose({
10571063
v: selectedNut.breakdown[i].value,
10581064
s: FINAL_CONFIG.style.chart.layout.nuts.selected.labels.dataLabels.suffix,
10591065
r: FINAL_CONFIG.style.chart.layout.nuts.selected.roundingValue
1060-
})
1066+
}),
1067+
{ datapoint: openNut, seriesIndex: i }
10611068
) }}
10621069
</text>
10631070
<text
@@ -1117,7 +1124,8 @@ defineExpose({
11171124
v: branch.value,
11181125
s: FINAL_CONFIG.style.chart.layout.branches.labels.dataLabels.suffix,
11191126
r: FINAL_CONFIG.style.chart.layout.branches.labels.dataLabels.roundingValue
1120-
})
1127+
}),
1128+
{ datapoint: branch }
11211129
)}}
11221130
</text>
11231131
<text

0 commit comments

Comments
 (0)