Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align caption vertically APEXCHARTS

I built this chart using Apex charts

chart

But both the 'Chart' title and the caption are not aligned, the title should be aligned relative to the graph, and the vertically aligned caption.

the title aligned so by placing the property align: 'center'

but my main problem is in the legend, I went behind the documentation and found this command verticalAlign: 'middle' to be used inside the ´legend:´ property.

Does anyone know how to make this work properly?

like image 703
Lucas Avatar asked Sep 03 '25 03:09

Lucas


1 Answers

The solution for vertically aligning the legend would be:

.apexcharts-legend {
  justify-content: center !important;
  top: 0 !important;
}

because you have to force overwrite the default which is justify-conent: flex-start

edit: you also need top: 0 !important to really get it centered but that might mess up your other charts

I guess for you this answer is one year too late but maybe it's helpful for someone else.

like image 63
Daniel Avatar answered Sep 05 '25 17:09

Daniel