Add an extra column to your DataTable with a role style:
data.addColumn( {'type': 'string', 'role': 'style'} );
Now add a style to each of the lines to get the desired effect:
data.addRows([[1,100, 'point {size: 14; fill-color: green'],
[2,150, 'point {size: 14; fill-color: green'],
....
[8,450, 'point {size: 14; fill-color: red']
]);
demo → http://jsfiddle.net/v92k8rty/
. (, , ) javascript, - RainbowVis-JS. RainbowVis , DataTable, :
var rainbow = new Rainbow();
rainbow.setNumberRange(1, data.getNumberOfRows());
rainbow.setSpectrum('green', 'red');
data.addColumn( {'type': 'string', 'role': 'style'} );
for (var i=0;i<data.getNumberOfRows();i++) {
data.setCell(i, 2, 'point { fill-color:'+rainbow.colorAt(i+1)+'}');
}
demo → http://jsfiddle.net/ehgfwh8z/