2013-07-23 41 views
0

我使用的是立體主義與石墨的數據來Cubism.JS門檻規模不

數據的域名是連續的[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 
); 

enter image description here

不應用規模(注意小的白色區域)

.call(context.horizon().height(100) 
    .colors(colors) 
    // .scale(d3.scale.threshold().domain([100]).range([0,100])) // range([0,1]) doesn't work either 
); 

enter image description here

回答

0

規模沒有工作,所以我用石墨的功能

具體我用

removeAboveValue(keepLastValue(xxx),99.99999)