question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New colors plugin doesn't color pie charts

See original GitHub issue

Feature 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LeeLenaleeecommented, Nov 3, 2022

np, can happen 😃 at least you still added a reproducable sample 😉

0reactions
stockiNailcommented, Nov 3, 2022

If you can do it, go for it, otherwise I will look if I have time for it tommorow evening

submitted

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found