You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "kmn988 (via GitHub)" <gi...@apache.org> on 2024/10/22 10:05:45 UTC
[I] [Feature] Custom background color for bar chart [echarts]
kmn988 opened a new issue, #20441:
URL: https://github.com/apache/echarts/issues/20441
### What problem does this feature solve?
Different color for each bar's background
### What does the proposed API look like?
backgroundStyle: {
color: (params) =>{
if (params.name === 'USA') return 'red'
return 'green'
},
borderRadius: 10,
},
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Feature] Custom background color for bar chart [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on issue #20441:
URL: https://github.com/apache/echarts/issues/20441#issuecomment-2454127387
Thanks for your demo. I think it makes sense. We should provide a callback form for it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Feature] Custom background color for bar chart [echarts]
Posted by "kmn988 (via GitHub)" <gi...@apache.org>.
kmn988 commented on issue #20441:
URL: https://github.com/apache/echarts/issues/20441#issuecomment-2443393150
> @kmn988 Can you provide more context about when this is necessary?
I have 2 usecases for this. The first one might not be very common but when I use the option
```
colorBy: "data"
```
I want to change the background color according to the bar's color like this

For the second usecase, when I have 2 horizontal bar charts next to each other, I want to show a fixed number of 5 bars each so the distance between each bar for both graph can be the same. If the chart doesn't have enough data, I have to create fake one. When I'm using dataset option, the result will be like this

However, I've just found out that using series's and axis's data option will give me the result that I want, which is no background for item with no value

I still want to have the latter result by using dataset, which is why I request this feature so I can set the background to transparent. Hope my explanation is clear for you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Feature] Custom background color for bar chart [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on issue #20441:
URL: https://github.com/apache/echarts/issues/20441#issuecomment-2441064147
@kmn988 Can you provide more context about when this is necessary?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org