Open joaovfabri opened 3 weeks ago
Hey, sorry that this is still an issue. That issue was a closed a long time ago before any of the current maintainers were around.
Reproduction https://codesandbox.io/p/sandbox/simple-line-chart-forked-tl8mw4
Looks like the intention is that a dot should be rendered if there is one datapoint. The problem being one data point is different than many datapoints with only 1 of them having a Y value
Don't see any issue with Bar chart https://codesandbox.io/p/sandbox/simple-line-chart-forked-9f449v
Hey! that's a lightning fast response, thanks a lot for that. It can be a problem as well when a set of points for a line contains multiple Nulls and a single point in between, like
{ varX: "Mon", varY: 10 },
{ varX: "Tue", varY: 8 },
{ varX: "Wed", varY: 5 },
{ varX: "Thu" },
{ varX: "Fri" },
{ varX: "Sat", varY: 10 },
{ varX: "Sun" },
I believe if you are using the dot
prop the dot will show in that case. If you are not using the dot prop I'm not sure what to do there - If you want those lines connected you can use connectNulls, otherwise it's just a point (without a dot) that isn't connected to anything.
Open to suggestions I guess.
Will look at this again tomorrow (it's late my time). Thanks!
with dot
Well, that's the problem, we don't want to use the dot prop to conform with our design. I can understand the difficulty of rendering a line, but would it make sense to enforce the Dot rendering on points like this, regardless of it using the dots or not?
You can make a custom dot which can be whatever you'd like as long as you have the info to render it correctly. But you'd have to do it conditionally else you'll always have a line and it will look strange.
I've never seen any other charting library use a line or anything but a dot to indicate an unconnected area data point. Not saying we shouldn't allow something different but this is current state.
Let's try a custom dot and see if it works out. Otherwise we can mark this a feature request.
Do you want to request a feature or report a bug?
What is the current behavior?
Current Version of Recharts (2.12.7) still presents a bug identical to the one reported in this issue #149.
Rendering an Area / Bar chart with isolated points (not only with single data points) will not display any representation in the chart for that point.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar (template: https://codesandbox.io/p/sandbox/simple-line-chart-v25dl4).
Reproduction is the same as mentioned issue, #149
What is the expected behavior?
Similar libraries will represent these points with e.g. lines coming from the x axis and back:
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
(2.12.7) Any browser