Skip to content

Commit 83af083

Browse files
committed
Update formatter
1 parent a0b5ecc commit 83af083

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

TestingArena/ArenaVueUiTreemap.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ const config = computed(() => {
228228
...c.style.chart.layout,
229229
labels: {
230230
...c.style.chart.layout.labels,
231-
formatter: (val) => {
232-
return `f - ${val}`
231+
formatter: ({value, config }) => {
232+
return `f - ${value}`
233233
}
234234
}
235235
},

src/components/vue-ui-treemap.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ function useTooltip({ datapoint, seriesIndex }) {
376376
v: datapoint.value,
377377
s: FINAL_CONFIG.value.style.chart.layout.labels.suffix,
378378
r: FINAL_CONFIG.value.style.chart.tooltip.roundingValue
379-
}))}</b>`;
379+
}),
380+
{ datapoint, seriesIndex }
381+
)}</b>`;
380382
381383
tooltipContent.value = `<div>${html}</div>`;
382384
}
@@ -620,7 +622,9 @@ defineExpose({
620622
v: rect.value,
621623
s: FINAL_CONFIG.style.chart.layout.labels.suffix,
622624
r: FINAL_CONFIG.style.chart.layout.labels.rounding
623-
}))
625+
}),
626+
{ datapoint: rect }
627+
)
624628
}}
625629
</span>
626630
</div>
@@ -675,7 +679,9 @@ defineExpose({
675679
v: legend.value,
676680
s: FINAL_CONFIG.style.chart.layout.labels.suffix,
677681
r: FINAL_CONFIG.style.chart.legend.roundingValue
678-
}))
682+
}),
683+
{ datapoint: legend }
684+
)
679685
}}
680686
<span v-if="!segregated.includes(legend.id)">
681687
({{ isNaN(legend.value / total) ? '-' : (legend.value / total * 100).toFixed(FINAL_CONFIG.style.chart.legend.roundingPercentage)}}%)

0 commit comments

Comments
 (0)