Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can you change legend label colour? #81

Closed
xlcrr opened this issue Mar 26, 2017 · 6 comments
Closed

How can you change legend label colour? #81

xlcrr opened this issue Mar 26, 2017 · 6 comments

Comments

@xlcrr
Copy link

xlcrr commented Mar 26, 2017

The default is brown

Is there a way to change this?

Thanks

@apertureless
Copy link
Owner

You can pass the defaultFontColor in the options.

Check out the Chart.js documentation for more info: http://www.chartjs.org/docs/#chart-configuration-colors

@xlcrr
Copy link
Author

xlcrr commented Mar 26, 2017

Solved this without actually passing the options object, just a legend object

eg

this.renderChart(data,
  {
// options
    legend: {
       labels: {
         fontColor: '#ffffff'
      }
   }
}

@xlcrr xlcrr changed the title How can you change label colour? How can you change legend label colour? Mar 26, 2017
@xlcrr xlcrr closed this as completed Mar 26, 2017
@geek4ctrl
Copy link

Does the solution work on your side?

@xlcrr
Copy link
Author

xlcrr commented Oct 24, 2019

Hi @geek4ctrl yes it works. Can we help?

@asadbr
Copy link

asadbr commented Sep 3, 2021

image
guys how to change the background color of it
but the background color of graph should not change

@natBizitza
Copy link

image guys how to change the background color of it but the background color of graph should not change

Just in case someone is still looking for the answer:

Use fillStyle to change the fill of the legend box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants