apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.36k stars 1.3k forks source link

Datalabel with Background and Transparency at ApexCharts #1063

Closed giuseppepaolo closed 4 years ago

giuseppepaolo commented 4 years ago

Is your feature request related to a problem? Please describe. The datalabels from charts aren't clear, when use more than one datasets.

Describe the solution you'd like I'd like to add one possibility to use background and transparency in datalabels, like this attachment.

Additional context image

junedchhipa commented 4 years ago

Providing background color for data labels is possible now Docs: https://apexcharts.com/docs/datalabels/

OzzyTheGiant commented 4 years ago

How do I change background color of a dataLabel in a Pie/Donut chart? All I get is a white background and the docs don't seem to specify anything about that.

junedchhipa commented 4 years ago

For pie/donuts data-labels background, try this

dataLabels: {
  enabled: true,
  style: {
    colors: ['#111']
  },
  background: {
    enabled: true,
    foreColor: '#fff',
    borderWidth: 0
  }
}
GantaVenkataKousik commented 3 months ago

This was fine . But this can only set the same color to all the labels . How to set different colors for different labels based on their label ?