Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customising each bar drawn within a chart #189

Open
markedup opened this issue Jul 12, 2018 · 7 comments
Open

Customising each bar drawn within a chart #189

markedup opened this issue Jul 12, 2018 · 7 comments

Comments

@markedup
Copy link

markedup commented Jul 12, 2018

What is the problem?

I'd like to visually round off the ends of a StackedBarChart element’s bars – both foreground data and background guides – like so:
StackedBarChart with rounded and shaded bars
I'd also like to apply a gradient effect to each bar, as per the illustration above.

However, having read through the documentation and looked at the examples, I haven't discovered if customisation for individual bar chart elements is possible in this specific way.

Can someone tell me how to apply these customisations to each bar please?

@JesperLekland
Copy link
Owner

I don't think we support rounded corners on bar-charts at the moment. We draw the bars as "shapes" instead of rectangles and as such the don't support any radius props.

The gradients is supported, have a look at this example

@markedup
Copy link
Author

Thanks @JesperLekland, appreciate the details regarding per-bar drawing options (specifically rounding).

Regarding the gradients, do you have an example of the gradient being applied relative to the bar's size within the overall graph "spectrum"? Or will I need to create a proportional gradient start and finish per bar, based on the overall chart gradient?

@JesperLekland
Copy link
Owner

@markedup Unfortunately don't have an example. I think you'll need to create one gradient per bar and do some calculations based on it's relation to the entire data set min/max. Perhaps some color interpolation

@markedup
Copy link
Author

markedup commented Jul 16, 2018

No worries, @JesperLekland – thanks again for your help. I was thinking it would need to be an interpolated, per-bar gradient; if I produce anything useful, I'll share it here.

@JesperLekland
Copy link
Owner

Great, thanks for the input. I'll keep this issue open to remind me about the borderRadius for BarChart

@Kendysond
Copy link

HI @markedup , were you able to solve this? I'm trying to do something similar, but I don't know how to make the color fill only a certain height of the bar
Screenshot 2019-05-30 at 12 06 42 AM

@JesperLekland Please I'd appreciate your thoughts on this too

@kieuquang1110tt
Copy link

@markedup Hi, pls help i dont know how to border this bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants