开发者

ApexCharts - How do I move the data label on pie chart?

I am trying to move my data labels inward so that they are easier to read. If there is a way to dynamically center them in the slice, that would be ideal.

ApexCharts - How do I move the data label on pie chart?

I've read the docs and tried modifying the X & Y.. i've tried -50 to 50 and nothing seems to be impacting the position of these labels. Am I missing something?

var PTDLastMonthOptions = {
    series: [35, 65],
    chart: {
        width: 300,
        type: 'pie',
    },
    legend: {
        position: 'bottom'
    },
    dataLabels: {
        enabled: true,
        offsetX: 50,
        offsetY: 50
    },
    colors: ['#00e396', '#ff4560'],
    labels: ['PAID', 'UNPAID']
};

var PTDLastMonthChart = new ApexCharts(document.querySelector("#ptdLastMonthChart"), PTDLastMonthOptions);
PTDLastMonthChart.render();

#Edit - 开发者_JAVA百科Adding codepen: https://codepen.io/flashsplat/pen/NWzowbx

Thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜