0

我正在使用来自石墨的数据的立体主义

数据的域是连续的 [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
);

在此处输入图像描述

4

1 回答 1

0

规模不起作用,所以我使用了石墨的功能

特别是我用过

removeAboveValue(keepLastValue(xxx),99.99999)

于 2013-07-24T15:04:15.473 回答