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

Restrict yScale to integer values

Open paulsonnentag opened this issue 7 years ago • 1 comments

I'm using react-linechart to plot the history of how many times an app was installed. It would be nice if I could restrict the yScale to only show ticks with integer values as opposed to ticks at 0.5 or 1.5.

paulsonnentag avatar Jul 04 '17 14:07 paulsonnentag

That would be nice indeed. Probably you want to chain a tickFormat method here and have something like:

const yAxisGen = d3.svg.axis().scale(yScale).orient("left").tickFormat(d3.format("d"));

Better still let the user choose a tickFormat function prop that will give him the ability to format in whatever crazy way he wants.

PR is welcome! :)

rafaelquintanilha avatar Jul 04 '17 18:07 rafaelquintanilha