question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use ReferenceLine as separator for BarCategories?

See original GitHub issue

Do you want to request a feature or report a bug?

feature proposal / approach discussion

What is the current behavior?

Before version 1.5.0 (in 1.4.4) ReferenceLine worked incorrect (1643, 1521)

And now I need to explain my problem. I’m trying to separate BarCategories with ReferenceLine like this: image

It obviously worked fine before 1.5.0 just with this simple code:

{map(xValues.slice(1), xValue =>
  <ReferenceLine key={xValue} x={xValue} stroke="#DBDBDB" />,
)}

But in 1.5.0, when ReferenceLine started work correctly, my lines shifted to correct positions — center of BarCategories:

image

So, my question is: How I can separate BarCategories with correct behaviour of ReferenceLine? Maybe make sense to add some position prop for ReferenceLine with values ['start', 'middle', 'end'], that allows you to select position of your ReferenceLine inside range of x/y. Or maybe you have any ideas how to implement this behavior with current API?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: http://jsfiddle.net/ndLhnegs/).

That’s not a bug, but example available here You can click on ‘Toggle ugly fix’ button to see my expected result

What is the expected behavior?

I described it above

Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?

Recharts: 1.4.3/1.5.0 OS: any os

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
EugeneDraitsevcommented, Apr 10, 2019

I created PR with fix for this issues. We need just to wait while it will be merged

0reactions
saratescommented, Apr 10, 2019

Yeah, ReferenceLine worked incorrect… it seems there is no working solution how we can put line between bars…

Read more comments on GitHub >

github_iconTop Results From Across the Web

recharts.online
Use Add reference line to create a reference line. Add reference line. Reference Dots. There aren't any reference dots yet. Use Add reference...
Read more >
REFERENCELINE Statement - SAS Help Center
Requirement: A REFERENCELINE statement can be used within a 2-D layout (OVERLAY, OVERLAYEQUATED, DATALATTICE, or DATAPANEL) only.
Read more >
ActiveReports 10 1 - Table of Contents - GrapeCity
Converting Crystal Reports/MS Access Reports. 48-51. Getting Started ... Click above the vertical scrollbar to grab the splitter control and drag downward.
Read more >
Exploring Recharts: multiple ReferenceLine segments
ReferenceLine can accept a segment prop which can take an array with 2 set of endpoints within which the line would be drawn....
Read more >
ActiveReports 8 User Guide - NET
Converting Crystal Reports/MS Access Reports. 44-47 . Getting Started ... Click above the vertical scrollbar to grab the splitter control and drag downward....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found