JesperLekland / react-native-svg-charts

📈 One library to rule all charts for React Native 📊
MIT License
2.34k stars 398 forks source link

bar chart rounded top #212

Open raygerrard opened 6 years ago

raygerrard commented 6 years ago

is it possible to have rounded top left and right corners on a bar chart?

phunkren commented 6 years ago

Doubtful, @raygerrard

(based on this comment)

vjsingh commented 6 years ago

I altered the library to do this for my own project. Not the prettiest, but it is working. Might be helpful for inspiration:

https://github.com/vjsingh/react-native-svg-charts/commit/3aa87dd1ab33df5542eb65cc6d80d5e9d66351c3

https://github.com/vjsingh/react-native-svg-charts/commit/eee9f210243d0395b57595c18b5b3d67ed1a7751

antoinerousseau commented 6 years ago

@vjsingh could you make a PR maybe?

vjsingh commented 6 years ago

@antoinerousseau maybe, would have to clean up the code quite a bit.

@JesperLekland Are you interested in a PR that adds an API for rounded corners to BarChart and StackedBarChart?

antoinerousseau commented 6 years ago

and maybe the path can be replaced by a Rect for simpler code?

JesperLekland commented 6 years ago

In my consideration of this feature I would definitely use Rect. Would be very interested in a PR 👍

JesperLekland commented 6 years ago

@vjsingh Thanks for the offer, but that implementation is unfortunately way too complex. Cool solution though 👍

vjsingh commented 6 years ago

@JesperLekland Thanks, it's a bit hacked together. I didn't think anyone would ever see this code =)

I can make a PR. The issue is, is there a way to only round some of the corners with Rect? That was the motivation, since rounding all the bars in a stacked bar chart it doesn't look good. We could of course hide the complexity behind our own Rect abstraction

mafiusu commented 5 years ago

Hello is there any progress on rounding the top corners in the BarChart?

ddnatu commented 5 years ago

Hi Guys, Anybody working on this ?

smismailalam commented 4 years ago

Anybody working on this ?

ajacquierbret commented 4 years ago

Yep, I'd be very interested in rounded corners (even bottom corners) for BarChart. Unfortunately, I don't have time to work on some PR. Maybe I'll try to dig a bit into the lib to see what I can do.

vjsingh commented 4 years ago

I moved over to Victory charts, been a lot happier with that library. It's better maintained I think.

puneetkansal04 commented 1 year ago

Hi @vjsingh I have checked this but this is not worked for me as i am using BarChart. let me know if there is any changes to do in BarGraph also.