d3 unevenly distributed scaling

こ雲淡風輕ζ 提交于 2019-12-12 18:03:40

问题


any suggestions for drawing axes with unequal spacing between the values. For instance I am currently drawing axes using:

yScale = d3.scale.linear().domain([0, 60000]).range([height, 0])

I need more spacing between 0 and 5000 than distributing all the data points equally


回答1:


Try using a polylinear scale:

yScale = d3.scale.linear().domain([0, 5000, 60000]).range([height, height/2, 0])

The range (0, 5000) and (5000, 60000) will both be given the same amount of space.



来源:https://stackoverflow.com/questions/16267293/d3-unevenly-distributed-scaling

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!