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.

Pie color and label not working properly after upgrade

See original GitHub issue

After 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:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
drxchengcommented, Dec 11, 2020

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!

0reactions
lezancommented, Dec 13, 2020

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 use colors={{ datum: 'color' }} as before. If I inspect each BarItem with React Developer Tools I can see each one with color: undefined. I am experience the same issue with 0.66.0 and 0.67.0. Is it a bug with Bar or something is changing but Scatterplot is not updated to the lastest API?

Thanks!

Read more comments on GitHub >

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

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