Create a D3 axis without tick labels

前端 未结 3 1241
旧时难觅i
旧时难觅i 2021-01-01 13:15

How can I create a D3 axis that does not have any labels at its tick markers?

Here\'s an example that shows what I\'m after, from Mike Bostock no less. There are sev

3条回答
  •  情话喂你
    2021-01-01 14:05

    Create a D3 axis without tick labels

    A tick mark without a label can be created by using a function that returns an empty string. This works in both the Javascript and Typescript versions of D3.

    d3.svg.axis().tickFormat(() => "");

    Further explained on github @types/d3-axis https://github.com/DefinitelyTyped/DefinitelyTyped/pull/24716#issuecomment-381427458

提交回复
热议问题