-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Facilitate styling the top line of area charts #79
Labels
Comments
Yep a PR for this would be great! |
franky47
added a commit
to franky47/react-charts
that referenced
this issue
Apr 29, 2020
tannerlinsley
pushed a commit
that referenced
this issue
Apr 29, 2020
🎉 This issue has been resolved in version 0.0.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello @franky47 and @tannerlinsley !! is this available? If so, how can I use it? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was looking at recreating this design with react-charts:
It contains two visual components:
After a discussion with @tannerlinsley on Twitter, who pointed out that Area graphs are made of two components (a line and a filled path, perfect !), I looked into styling them separately using
getSeriesStyle
.Looking at the Area component code, both the line and the area path use the same styling inputs, with the exception of the line having an extra
fill: none
property.Unfortunately for this design, setting a stroke of 2px for the line would also set it for the area, which produces an undesired outline at the bottom and sides of the graph:
One way I solved this in my project was to use external CSS to disable the stroke on the area path:
I would like to open a PR suggesting an additional
area
property in what is returned bygetSeriesStyle
, so that each path can be styled separately without relying on external CSS.Example:
In order not to break existing designs, the area path could use properties from both line and area:
const areaPathProps = { d: areaPath, style: { ...defaultAreaStyle, ...style, ...style.line, + ...style.area } };
Comments and suggestions are welcome !
The text was updated successfully, but these errors were encountered: