'VUE3 dataLabels stacked column apex chart
Solution 1:[1]
Here is formatter I come up with, should work for any number of series
formatter: function (value, { seriesIndex, dataPointIndex, w }) {
let numberOfSeries = w.config.series.length - 1
if(seriesIndex == numberOfSeries){
return w.globals.stackedSeriesTotals[dataPointIndex];
} else if (seriesIndex<numberOfSeries){
let sum = 0
while (seriesIndex < numberOfSeries) {
seriesIndex++;
sum+= w.config.series[seriesIndex].data[dataPointIndex] || 0
}
if (sum === 0) return w.globals.stackedSeriesTotals[dataPointIndex];
}
},
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Patryk Laszuk |

