question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apex charts dataLabel styling is not working

See original GitHub issue

Codepen

I want to add a style for those dataLabels.

donut-datalabels

I tried out this as mentioned in the docs

options : {
...
 dataLabels: {
  enabled: true,
  enabledOnSeries: undefined,
  formatter: function (val, opts) {
      return val
  },
  textAnchor: 'middle',
  distributed: false,
  offsetX: 0,
  offsetY: 0,
  style: {
      fontSize: '14px',
      fontFamily: 'Helvetica, Arial, sans-serif',
      fontWeight: 'bold',
      colors: undefined
  },
  background: {
    enabled: true,
    foreColor: '#fff',
    padding: 4,
    borderRadius: 2,
    borderWidth: 1,
    borderColor: '#fff',
    opacity: 0.9,
    dropShadow: {
      enabled: false,
      top: 1,
      left: 1,
      blur: 1,
      color: '#000',
      opacity: 0.45
    }
  }
  },
...
}

both style and background are not working !!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
jfayadcommented, Jun 24, 2020

hello @junedchhipa It’s not really clear if that is a bug or a new feature ?

According to the doc. it seems that this should be working so this issue seems like a bug to me. If that’s the case, shouldn’t this issue stay open till the bug is addressed and merged ?

Thanks

4reactions
junedchhipacommented, May 29, 2020

It seems background for the pie/donut labels doesn’t work in pie/donut charts.

For the forecolors, you can try

dataLabels: {
  style: {
    colors: ['#111', '#555', '#999']
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

dataLabels - ApexCharts.js
Similar to plotOptions.bar.distributed , this option makes each data-label discrete. So, when you provide an array of colors in datalabels.style.colors ...
Read more >
Apex charts text align styling in dataLabel - Stack Overflow
How to make align to right side for values in chart ? This is my chart: my chart. I'm trying to separate the...
Read more >
ApexCharts when no data, annotation is shown - CodePen
label : {. 12. borderColor: 'transparent',. 13. style: {. 14. color: "red",. 15. background: 'transparent',. 16. },. 17. text: "Annotation text",.
Read more >
Data Visualization With ApexCharts - Smashing Magazine
Here is a sample of how the components of an ApexChart work together. ... Next, we define the style and font-size of the...
Read more >
ApexCharts & Bootstrap Integration by Keenthemes
ApexCharts ' CSS and Javascript files are bundled in the global style and ... data: [44, 55, 57, 56, 61, 58] }, {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found