我用立方体和石墨的数据
数据的域为连续0,100,范围为连续0,100,但低于100的任何内容都是无稽之谈,因此我修改了标度,并使用了阈值标度,以便:
值< 100将为0,而100将为100。我用以下方法测试过:
var scale = d3.scale.threshold().domain([100]).range([0,100])
console.log(scale(1)) //returns 0
console.log(scale(99.9)) //returns 0
console.log(scale(88.9)) //returns 0
console.log(scale(100)) //returns 100当我应用它时,整个图表就变成空的了。
.call(context.horizon().height(100)
.colors(colors)
.scale(d3.scale.threshold().domain([100]).range([0,100])) // range([0,1]) doesn't work either
);

没有应用刻度(注意小的白色区域)
.call(context.horizon().height(100)
.colors(colors)
// .scale(d3.scale.threshold().domain([100]).range([0,100])) // range([0,1]) doesn't work either
);

发布于 2013-07-24 15:04:15
刻度不起作用,所以我使用了石墨的功能
特别是我用了
removeAboveValue(keepLastValue(xxx),99.99999)
https://stackoverflow.com/questions/17822798
复制相似问题