Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


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.) https://mdbootstrap.com/snippets/standard/alexandroni/3084818


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: https://mdbootstrap.com/snippets/standard/m-duszak/3102516


Michał Duszak staff answered 3 years ago


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

Keep Coding,

Michal



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

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
Tags