Apex charts text align styling in dataLabel

Viewed 791

How to make align to right side for values in chart ? This is my chart: my chart

I'm trying to separate the percentages to the right, and the text should remain on the left side as in the following image: the layout of the diagram I am trying to make

Is it possible to add css command to the formatter function or there is some other way to keep the values ​​on the right ? My formatter function looks like this:

  dataLabels: {
                        enabled: true,
                        textAnchor: 'start',
                        style: {
                            colors: ['#333333'],
                        },
                        formatter: function (val, opt) {                   
                            return opt.w.globals.labels[opt.dataPointIndex] + " "  + val + "%"
                        },
                        offsetX: 0,
                        dropShadow: {
                            enabled: false
                        }
                    }
0 Answers
Related