nyaplot icon indicating copy to clipboard operation
nyaplot copied to clipboard

Ability to manually set intervals of X axis.

Open v0dro opened this issue 10 years ago • 1 comments

Here's my use case:

I have a plot whose X co-ordinates exist only at integer co-ordinates (1,2,3,4,5,6), and I want to see the X axis show me only the integers at which the points exist, i.e. 1,2,3,4,5,6.

It so happens that nyaplot also displays in-between decimal numbers (0,0.5,1,1.5,2...). Having the ability to customize the step size between valid X co-ordinates would be great. OR maybe have the ability to display only the integer X co-ordinates.

Here's a picture of how the X axis looks as of now: screenshot from 2015-06-09 22 49 28

v0dro avatar Jun 09 '15 17:06 v0dro

You can implement it by adding some lines to: https://github.com/domitry/Nyaplotjs/blob/master/src/view/components/axis.js#L34

See also: https://github.com/mbostock/d3/wiki/SVG-Axes

domitry avatar Jun 25 '15 03:06 domitry