Pie color and label not working properly after upgrade
See original GitHub issueAfter upgrading from 0.62 to 0.67. Our current code is broken.
First, PieDatum
is no longer exported. Fixed that by using DefaultRawDatum
.
Then, found out the color and label are not working properly. I was using colors={{ datum: 'color' }}
.
Color is showing black. Changing to colors={{ datum: 'data.color' }}
doesn’t work either. Workaround is changing to colors={datum => datum.data.color}
, but I do prefer the old method as it is cleaner.
Labels are showing id
instead of label
value. Workaround is changing id to use label value.
The passed data is
[
{
color: '#1b3558',
id: "0",
label: "question 1",
value: 28,
},
{
color: '#07579e',
id: "1",
label: "question 2",
value: 22,
}
]
I’m following the example. Is there any breaking changes that I am not aware?
I’m on Mac, latest Chrome.
Thank you! Great project!
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Updating Pie Chart with Specific colors not working as expected
I expect the Pie Chart to have three colors after clicking the update button. However, there are still four arcs. I assue, the...
Read more >Detail label color in Pie chart not working inside
Changing the detail label color for labels inside the chart doesnt work.
Read more >Video: Customize a pie chart - Microsoft Support
Click the chart you want to change. In the upper- right corner, next to the chart, click Chart Styles. Click Color and pick...
Read more >Change the format of data labels in a chart - Microsoft Support
You can format the labels to show specific labels elements like, the percentages, series name, or category name. Pie chart with data labels...
Read more >Pie chart data labels not updating! | MrExcel Message Board
Make sure that the Data sheet(s) are not hidden. When the sheets are hidden, the label on the graph will not update.
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
Couldn’t figure out. Maybe it’s because of some other dependencies. I will try in the future. Thanks for the support! Again, great project!
I am experience the same issue with Bar component. I am not able to change color according to color included in data.
colors={{ datum: 'color' }}
is not working anymore, but as suggested by @drxcheng,colors={{ datum: 'data.color' }}
works. With Scatterplot component I do not have this kind of issue, instead I can usecolors={{ datum: 'color' }}
as before. If I inspect each BarItem with React Developer Tools I can see each one withcolor: undefined
. I am experience the same issue with0.66.0
and0.67.0
. Is it a bug with Bar or something is changing but Scatterplot is not updated to the lastest API?Thanks!