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

Bar Graph with Area #1295

Closed
sfiorotti opened this issue Nov 17, 2020 · 5 comments
Closed

Bar Graph with Area #1295

sfiorotti opened this issue Nov 17, 2020 · 5 comments
Labels

Comments

@sfiorotti
Copy link

Hey guys, how are you?
I need to give some alternatives to our designer, he drew this bar graph with an area indicating the percentage

screencapture-figma-file-rTxGTuBTmQbs1ttpIt3s3V-Dashboard-2020-11-17-10_39_53

I thought about exporting the Areas component in the line package, what do you think?
Because I don't know if this type of graph makes sense, or if so, I can try to implement it directly in the bar graph.

@wyze
Copy link
Contributor

wyze commented Nov 17, 2020

You could achieve this with a custom layer passed to the Bar chart.

@wyze wyze added 📊 bar @nivo/bar package ℹ️ question labels Nov 17, 2020
@sfiorotti
Copy link
Author

Yes, but I saw an Areas component in the @nivo/line that could be reused here in this case, I just need it to be exported. makes sense? can I submit a PR?

@wyze
Copy link
Contributor

wyze commented Nov 17, 2020

I'm not sure if we want to be exporting internal components like that, @plouc?

I'm also not sure how helpful it would be to you given your requirements. It will draw the area under the lines for data you give it, which will be different than what you pass to the Bar chart. Given where the areas are drawn in related to your bars, I think it would be more work to reuse than component than to draw the paths manually.

@sfiorotti
Copy link
Author

okay, i will make a custom layer, if this is interesting let me know i can put it in the @nivo/bar package! Thanks @wyze!

@ollwenjones
Copy link
Contributor

@sfiorotti I ran across this example which was helpful to me:
https://codesandbox.io/s/m4ro13jjn8

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

No branches or pull requests

3 participants