I’m working on a bubble chart using ApexCharts and I’m having trouble centering the data labels in the middle of each bubble. I’ve searched the documentation and found options to set the horizontal alignment but nothing specific for vertical alignment.
Here’s a sample data file I’m using for testing: Sample Data File.
I’ve set up a sandbox for testing: Sandbox.
Here is what the chart looks like using the sample data file
I want each data label to be centered both horizontally and vertically within its corresponding bubble. Right now, in the image, the labels are only centered horizontally but not vertically, it is slightly offsetted below.
Some of the things I tried is:
- Setting
offsetY
: This moves the labels but affects all bubbles uniformly, not centering them within each individual bubble. - Using
offsetY
as an array and setting it via a custom function: This approach didn’t yield the desired results.
ndlphong is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.