Search code examples
amchartsamcharts4

How to change the colors of Legends in AM Bar Charts?


What I have now is Current

But I want to change the colors of Legends, and achieve like below as it should match the colors of the bars. Desired One

Despite trying chart.legend.backround.fill and chart.legend.data with fill property, I am unable to change the colors


Solution

  • Thank you @Samuel I have solved my problem! Desired Output

    Chart.legend.data = [{ "name": "Normal", "fill": "#28a745" }, { "name": "Underweight", "fill": "#ffc107" }];

    Was missing!

    The Code Pen can be found Here