Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

D3 Axis ticks hard count

Is there a way for the count argument to .ticks() to be a hard value that is to be adhered to exactly instead of a hint? There are some cases where this formatting is really something that you want to have.

like image 602
Alper Avatar asked Jan 21 '13 18:01

Alper


1 Answers

You can use the function .tickValues() to set the tick values explicitly. If called with no arguments, it returns the current tick values -- this would allow you to check how many there are and add/remove/recalculate as needed.

like image 88
Lars Kotthoff Avatar answered Sep 30 '22 13:09

Lars Kotthoff