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.

Dynamic Fill color option for each bars in simple bar graph

See original GitHub issue

How can I give different fill color for each bar in simple bar graph?

<BarChart data={barsData}> <XAxis ...../> <YAxis ...../> <Bar fill= **dynamic_color_here** ..... /> </BarChart>

For example 1:- Let say, I have to show Employee_Name at XAxis and employee_salary at YAxis. Each bar represents a single employee. I want each of my bar to have different color which I want to provide dynamically.

For example 2:- month_name at XAxis and max_temp at YAxis. Each bar represents a month. I want each of my bar to have different color based on temperature which I want to provide dynamically.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

33reactions
xile611commented, Apr 13, 2017

Similar to this demo.

18reactions
mchong-tealcommented, Oct 17, 2019

link is broken.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vary the colors of same-series data markers in a chart
Set varying colors of data markers (bars, columns, lines, pie or doughnut slices, dots, and other shapes) automatically in an Office chart.
Read more >
Change Color of Bars in Barchart using ggplot2 in R
In this article, we are going to see various methods to change the color of a bar chart using ggplot2 in the R...
Read more >
Simple Excel Trick to Conditionally Format Your Bar Charts
If you want to help your audience to make sense of your Excel chart quickly, consider color coding it. In this video I'll...
Read more >
How to color chart bars based on their values - Get Digital Help
This article demonstrates two ways to color chart bars and chart columns based ... Smaller than the previous value and the bar will...
Read more >
Different color for each bar in a bar chart; ChartJS
As of v2, you can simply specify an array of values to correspond to a color for each bar via the backgroundColor property:...
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