EES-5067 add ref lines between data points on major axis #4757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the ability to position reference lines between data points on the major axis on vertical bar charts (they can't be added on other types of chart).
Recharts doesn't allow reference lines to be positioned like this: "If the specified x-axis is a category axis, the value of x must be one of the categorys (sic), otherwise no line will be drawn" (https://recharts.org/en-US/api/ReferenceLine), so I've had to be a bit 'creative':
CustomReferenceLineLabel
it draws a new line perpendicular to the existing one, using theviewbox
, chart height and margin to calculate its positionstroke
tonone