0

I'm trying to create an axis with d3.svg.axis() but when I trying to create Subdivide ticks, the axis not changing. I've read some related documents but they could't help me to figure it out! This is an example that used d3.svg.axis().tickSubdidvie() but still not working. Finally I've check this example and find tickSubdidvie() function just working in d3js V2 and not working in d3js V3.5.5 . Could any body tell me how can I handle it?

Complete jsfiddle link.

Gabriel
  • 1,413
  • 1
  • 18
  • 29
  • What are you trying to achieve? You can set the tick values through `.tickValues()`. – Lars Kotthoff Jul 02 '15 at 16:37
  • I'm trying to create Subdivide ticks, usually we use `tickSubdidvede()` function. [This](http://stackoverflow.com/questions/31139642/major-and-minor-ticks-with-different-style-whole-page-covered-d3) a question I asked before. When I tried to solve my problem I was faced with a new problem and it is: Why `tickSubdidvide()` function not working in d3js v3.5.5 but it's work in d3js v2? I compared two `tickSubdidvide()` function with different version but I couldn't handle it. – Gabriel Jul 02 '15 at 19:38
  • You simply can't do this anymore in the current version of D3. It doesn't have a notion of major and minor ticks. – Lars Kotthoff Jul 02 '15 at 19:43
  • It's very simple in D3 v2 just by using `tickSubdidvide()` function and `.axis .minor` style class and add `tickSize()` function as you mention before, But the problem is V2 missed some feathers such as could not read `csv` files so I should use new version. is there any solution for my problems? How can I customize `tickSubdidvide()` in new version of D3? is there any specific reason that programming group of D3 remove this feather from new version or it's a bug? – Gabriel Jul 02 '15 at 19:54
  • 1
    See [this question](https://stackoverflow.com/questions/21643787/d3-js-alternative-to-axis-ticksubdivide). – Lars Kotthoff Jul 02 '15 at 19:58
  • Thank you it was useful. – Gabriel Jul 02 '15 at 20:04

1 Answers1

0

An alternative to drawing two axes is to draw all the ticks initially, then re-select them and adjust their styles according to their data or index values. The new way to do this is to have several axes, one for the major ticks and another one for the minor ones. You would select the ticks that also appear on the major axis for the minor one and remove them. More information here and here.

Gabriel
  • 1,413
  • 1
  • 18
  • 29