New colors plugin doesn't color pie charts
See original GitHub issueFeature Proposal
In version 4 (I’m testing alpha 3), there is new colors plugin which should set a default colors for dataset. PR 10764.
There are checks in the plugin to understand the type of the chart but “pie” chart type (must be the same of “doughnut”) is missing and the plugin is not coloring the pie chart correctly.
Codepen: https://codepen.io/stockinail/pen/yLEOZxo
Possible Implementation
I think an additional check should be added, as following:
if (type === 'doughnut' || type === 'pie') {
colorizer = createDoughnutDatasetColorizer();
} else if (type === 'polarArea') {
colorizer = createPolarAreaDatasetColorizer();
} else {
colorizer = createDefaultDatasetColorizer();
}
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Automatic colors assignment in chart.js 2.x doesn't work ...
The only related question I've found is this one: Random fill colors in Chart. js however, as explained above, it perfectly worked on...
Read more >Colors | Chart.js
Colors. Charts support three color options: for geometric elements, you can change background and border colors;; for textual elements, ...
Read more >Change the color of the active pie chart as follows - YouTube
Change the color of the active pie chart as follows:RAM Memory to Black, Text 1 Hard Drive to Red, Screen to White, Background...
Read more >How to change color on pie chart(chart.js)? - wpDataTables
We used hex color codes with some random colors, but you can change it for your needs. There are six of them (if...
Read more >Changing pie chart colors (and colors for other reports)
After some digging and tweaking, I get the color on the first pie chart on the scene. I have 2 pies on one...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
np, can happen 😃 at least you still added a reproducable sample 😉
submitted