We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I used the Chart.js sample of Doughnut and I used Patternomaly to create canvas pattern. This is what I'm expecting:
This is the code of scriptable options :
backgroundColor: function(context) { var index = context.dataIndex; if (index === 0){ return pattern.draw('square', '#ff6384'); } if (index === 1){ return pattern.draw('circle', '#36a2eb'); } if (index === 2){ return pattern.draw('diamond', '#cc65fe'); } if (index === 3){ return pattern.draw('triangle', '#ffce56'); } return pattern.draw('zigzag', '#fcc465'); },
Using scriptable options, the result is the legend item color is black.
If, instead of using scriptable options, I'm passing the array of pattern, it works.
backgroundColor: [ pattern.draw('square', '#ff6384'), pattern.draw('circle', '#36a2eb'), pattern.draw('diamond', '#cc65fe'), pattern.draw('triangle', '#ffce56'), pattern.draw('zigzag', '#fcc465') ],
I've tested also my canvas pattern (not by Patternomaly) and the result is the same.
The text was updated successfully, but these errors were encountered:
I think this is due to #2281. The code for the legend items is
Chart.js/src/plugins/plugin.legend.js
Lines 49 to 67 in 75e76cf
resolve
Sorry, something went wrong.
#5621 addresses the issue in the legend with scriptable options.
Successfully merging a pull request may close this issue.
Expected Behavior
I used the Chart.js sample of Doughnut and I used Patternomaly to create canvas pattern. This is what I'm expecting:
This is the code of scriptable options :
Current Behavior
Using scriptable options, the result is the legend item color is black.
If, instead of using scriptable options, I'm passing the array of pattern, it works.
I've tested also my canvas pattern (not by Patternomaly) and the result is the same.
Environment
The text was updated successfully, but these errors were encountered: