In series, I want to output the value as text above each bar without reflecting ‘ongoing’ data in the chart. I tried to hide series by setting [0, 1, 2, 3] in enabledOnSeries below, but it doesn’t work. All data except ‘ongoing’ data are numbers between 1 and 10, but ‘ongoing’ data consists of numbers between 20 and 200. Therefore, when outputting ongoing data as a stacked bar, data other than ‘ongiong’ is buried in the ground and cannot be seen well. And for visualization, I want the ‘ongoing’ data to be printed as text above each bar. Believe it or not, it took me 3 days to find a solution. If anyone knows about apexchart, please help me.
dataLabels: {
enabled: true,
enabledOnSeries: [1]
},
[dashboard.html]
<script>
var options3 = {
series: [
{
name: 'I',
data: {{ I | safe }}
}, {
name: 'S',
data: {{ S | safe }}
}, {
name: 'P',
data: {{ P | safe }}
}, {
name: 'E',
data: {{ E | safe }}
}, {
name: 'ongoing',
data: {{ ongoing | safe }}
},
],
chart: {
type: 'bar',
height: 550,
stacked: true,
},
plotOptions: {
bar: {
dataLabels: {
position: 'center',
},
}
},
dataLabels: {
style: {
fontSize: '10px',
colors: ["#304758"]
}
},
stroke: {
width: 1,
colors: ['#fff']
},
title: {
text: 'I-S-P-E chart',
offsetY: 0,
align: 'center',
},
xaxis: {
categories: {{ teacher | safe }},
},
yaxis: {
title: {
text: undefined
},
},
fill: {
opacity: 1
}
};
var chart3 = new ApexCharts(document.querySelector("#dashboard"), options3);
chart3.render();
</script >