Use d3 log scale instead of linear scale

后端 未结 2 1813
再見小時候
再見小時候 2021-02-12 23:40

I\'m trying to do a chart based on http://mbostock.github.com/d3/talk/20111116/bar-hierarchy.html, the only difference being that I\'d like to use a log scale for the x-axis.

2条回答
  •  执念已碎
    2021-02-13 00:10

    There are a few other places where the domain for the scale is set. You need to update those as well.

    Working jsfiddle here.

    And here's some code so that it allows me to post this:

    x.domain([1, root.value]).nice();
    

提交回复
热议问题