What does it take for .ticks() to work?

后端 未结 4 1338
孤独总比滥情好
孤独总比滥情好 2021-01-04 08:58

.ticks() doesn\'t seem to be working on my bar chart. Can somebody take a look?

Here\'s the fiddle. I set ticks on the x-axis near the beginning of the object:

4条回答
  •  死守一世寂寞
    2021-01-04 09:24

    A css-way to do this is to hide the nth axis elements you do not want. The d3 ticks, to me, is just perpetually annoying.

    .tick:nth-of-type(6) > text {
        display: none;
      }
      .tick:nth-of-type(7) > text {
        display: none;
      }
      .tick:nth-of-type(8) > text {
        display: none;
      }
    

提交回复
热议问题