我正在开发一个社团网站,使用了
我已经阅读了文档,并在datalabels选项中进行了搜索。我的想法是:
apexCharts.js
。我想展示一个简单的饼图,但是当我显示时,datalabel上的值是一个百分比。我不想把它们转换成数值,当然,当我们悬停在饼图上时,真实值会显示出来。我已经阅读了文档,并在datalabels选项中进行了搜索。我的想法是:
formatter: function(val) { return val }
但是它没有起作用......
所以我在Github和这里都没有找到解决这个问题的例子。
以下是我的脚本:
var options = {
chart: {
width: 650,
type: 'pie',
},
labels: ['Date formation',
'Date formation 1',
'Date formation 2',
'Date formation 3',
'Nombre de jours restant ',
'Nombre de formations restantes'
],
series: [202, 80, 62, 250, 52, 30],
/* this portion NEED custom ???? */
formatter: function (val) {
return val
},
title: {
text: "Jours de formation produits ou plannifiés"
},
responsive: [{
breakpoint: 480,
options: {
chart: {
width: 200
},
legend: {
position: 'center'
}
}
}]
}
var chart = new ApexCharts(
document.querySelector("#chart"),
options);
chart.render();