Topic: Change chart legend color

Alexandroni free asked 3 years ago

Expected behavior change color of labels. Since the background is dark its necessary change the colors os all text, legends and labels to white

Actual behavior not change the colors

Resources (screenshots, code snippets etc.)

salas ljs priority answered 1 year ago

But the code do not valid in mdb Version: PRO 6.1.0. Hope fixed the problem.

Michał Duszak staff answered 3 years ago

Hello,you can change color with options as a second argument.

const options =  { 
options: {
  legend: {
    position: 'top',
        labels: {
        fontColor: 'green'
new mdb.Chart(document.getElementById("chart-line"), dataLine, options);

I refactored your snippet:

Michał Duszak staff answered 3 years ago

Thank you for your feedback. We will take adding this feature under consideration.

Keep Coding,


Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.5.1
  • Device: pc
  • Browser: firefox
  • OS: windows
  • Provided sample code: No
  • Provided link: Yes