Apexcharts.js: Donut chart labels not hiding

Created on 10 Aug 2018  路  1Comment  路  Source: apexcharts/apexcharts.js

using this configuration

const config = {
    chart: {
      width: 380,
      type: 'donut',
    },
    series: [44, 55, 41, 17, 15],
    legend: {
      show: false
    },
    plotOptions: {
      pie: {
        dataLabels: {
          name: {
            show: false
          },
          value: {
            show: false
          }
        }
      }
    }
}

This comes out
sketch

Any idea how to hide labels?

Most helpful comment

Hi @jimfilippou
The dataLabels configuration which you have written is only applicable for radialBar charts (name/value).

For a global dataLabels configuration, you have to set the options in
options.dataLabels.enabled = false

So, your config will look like

const config = {
    chart: {
      width: 380,
      type: 'donut',
    },
    series: [44, 55, 41, 17, 15],
    legend: {
      show: false
    },
    dataLabels: {
      enabled: false
    }
}

The options.dataLabels is applicable to all chart type and you can read more here https://apexcharts.com/docs/options/datalabels/

>All comments

Hi @jimfilippou
The dataLabels configuration which you have written is only applicable for radialBar charts (name/value).

For a global dataLabels configuration, you have to set the options in
options.dataLabels.enabled = false

So, your config will look like

const config = {
    chart: {
      width: 380,
      type: 'donut',
    },
    series: [44, 55, 41, 17, 15],
    legend: {
      show: false
    },
    dataLabels: {
      enabled: false
    }
}

The options.dataLabels is applicable to all chart type and you can read more here https://apexcharts.com/docs/options/datalabels/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rcoundon picture rcoundon  路  3Comments

thellimist picture thellimist  路  3Comments

cstlaurent picture cstlaurent  路  3Comments

jlil picture jlil  路  3Comments

drew-dulgar picture drew-dulgar  路  3Comments