react-vis icon indicating copy to clipboard operation
react-vis copied to clipboard

Y Axis ticks do not extend full Y domain

Open spartacus72 opened this issue 4 years ago • 2 comments

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?

spartacus72 avatar Jan 13 '21 16:01 spartacus72

Ive posted this on stackoverflow. this includes images of what im trying to accomplish...

https://stackoverflow.com/questions/65710486/react-vis-y-axis-scale

spartacus72 avatar Jan 14 '21 08:01 spartacus72

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]}

timtucker avatar Jan 17 '21 19:01 timtucker