-
Notifications
You must be signed in to change notification settings - Fork 762
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
chart-colors not working #532
Comments
This is because the names have changed. "fillColor", "strokeColor", etc. no longer work. I looked at the Chart.js documentation (see [http://www.chartjs.org/docs/#chart-configuration-colors]) and the angular-chart.js code, and found the following:
...where "color" is your rgb values. So this means the angular-chart.js documentation needs to be updated to match. In your case,
I don't know what the highlight colors would be (probably the pointHover colors). Pro Tip: The chart-colors attribute is just appended to the Chart.js datasets array, so you can also set other dataset attributes like "fill," "spanGaps," "linetension," and so on. Borrowing from a solution given in #258, I pass the output of this function to $scope.chartColors, and set the canvas' chart-colors attribute to that (chartColors).
|
Thanks! I got rid of highlightFill and highlightStroke. Then changed fillColor and strokeColor like you suggested and its working the exact way I wanted. I appreciate the time you took to answer this very detailed and correct answer. |
When adding the attribute chart-colors to the canvas for a bar graph:
The bar colors instantly go to a grey -> rgba(0,0,0,0.1) as the global default noted in: http://www.chartjs.org/docs/#chart-configuration-colors.
It doesn't matter what inputs are in the array, but the fact that there is an array makes it go to grey. I know it is registering because the grey bar is different than the default bar color. By using:
I am able to change the chart color, but not all the specific details that I want to change. Any help is appreciated. Thanks!
The text was updated successfully, but these errors were encountered: