@@ -347,13 +347,18 @@ const mutableDataset = computed(() => {
347347});
348348
349349
350- function makeDataLabel ({ value, index }) {
351- return dataLabel ({
352- p: FINAL_CONFIG .value .style .chart .yAxis .labels .prefixes [index] || ' ' ,
353- v: value,
354- s: FINAL_CONFIG .value .style .chart .yAxis .labels .suffixes [index] || ' ' ,
355- r: FINAL_CONFIG .value .style .chart .yAxis .labels .roundings [index] || 0
356- });
350+ function makeDataLabel ({ value, index, datapoint }) {
351+ return applyDataLabel (
352+ FINAL_CONFIG .value .style .chart .yAxis .labels .formatters [index] || null ,
353+ value,
354+ dataLabel ({
355+ p: FINAL_CONFIG .value .style .chart .yAxis .labels .prefixes [index] || ' ' ,
356+ v: value,
357+ s: FINAL_CONFIG .value .style .chart .yAxis .labels .suffixes [index] || ' ' ,
358+ r: FINAL_CONFIG .value .style .chart .yAxis .labels .roundings [index] || 0
359+ }),
360+ { datapoint, seriesIndex: index }
361+ )
357362}
358363
359364const selectedItem = ref (null );
@@ -390,12 +395,17 @@ function useTooltip({ shape, serieName, serie, relativeIndex, seriesIndex }) {
390395 <div class="vue-ui-tooltip-item" style="text-align:left">
391396 <span>${ s} : </span>
392397 <span>
393- ${ dataLabel ({
394- p: FINAL_CONFIG .value .style .chart .yAxis .labels .prefixes [i] || ' ' ,
395- v: serie .datapoints [i].value ,
396- s: FINAL_CONFIG .value .style .chart .yAxis .labels .suffixes [i] || ' ' ,
397- r: FINAL_CONFIG .value .style .chart .yAxis .labels .roundings [i] || ' ' ,
398- })}
398+ ${ applyDataLabel (
399+ FINAL_CONFIG .value .style .chart .yAxis .labels .formatters [i] || null ,
400+ serie .datapoints [i].value ,
401+ dataLabel ({
402+ p: FINAL_CONFIG .value .style .chart .yAxis .labels .prefixes [i] || ' ' ,
403+ v: serie .datapoints [i].value ,
404+ s: FINAL_CONFIG .value .style .chart .yAxis .labels .suffixes [i] || ' ' ,
405+ r: FINAL_CONFIG .value .style .chart .yAxis .labels .roundings [i] || ' ' ,
406+ }),
407+ { datapoint: serie .datapoints [i], seriesIndex: i }
408+ )}
399409 </span>
400410 </div>
401411 ` ;
@@ -624,7 +634,7 @@ defineExpose({
624634 :font-weight =" FINAL_CONFIG.style.chart.yAxis.labels.ticks.bold ? 'bold' : 'normal'"
625635 :style =" `opacity:${selectedItem && !mutableConfig.showTooltip ? 0.2 : 1}`"
626636 >
627- {{ makeDataLabel({ value: tick.value, index: i }) }}
637+ {{ makeDataLabel({ value: tick.value, index: i, datapoint: tick }) }}
628638 </text >
629639 </template >
630640 </g >
@@ -699,7 +709,7 @@ defineExpose({
699709 @mouseleave =" selectedItem = null; isTooltip = false;"
700710 :style =" `opacity:${selectedItem ? selectedItem === serieSet.id ? 1 : 0.2 : 1}`"
701711 >
702- {{ makeDataLabel({ value: dp.value, index: k }) }}
712+ {{ makeDataLabel({ value: dp.value, index: k, datapoint: dp }) }}
703713 </text >
704714 </template >
705715
0 commit comments