react-vis
react-vis copied to clipboard
Y Axis ticks do not extend full Y domain
The issue I am facing is that the Y Axis values stop before the end of my data in a bar chart. What I need is for the numbers to extend beyond the bars in the chart.
I have managed to do this by altering ticks.js in d3-array, so that it adds 1 number beyond the data set domain.
For example I changed...
while (++i < n) ticks[i] = (start + i) * step;
to be...
while (++i <= n) ticks[i] = (start + i) * step;
Is there a less Hacky way to accomplish this already?
Ive posted this on stackoverflow. this includes images of what im trying to accomplish...
https://stackoverflow.com/questions/65710486/react-vis-y-axis-scale
For the parent XYPlot componet, you can control the range of what's shown using yDomain.
For your example, try something like: yDomain={[0, maxValue * 1.25]}