Smartclient 9.0 does not allow users to specify a spectrum coloring scale as hilites for a ListGrid. It looks like you have a similar concept planned for Smartclient 10.0.
What would be nice would be to let users specify an array of colors, a min, and a max, and have columns in a ListGrid be colored accordingly.
I've implemented something that works for me, but this is something that I would guess that a lot of users would appreciate. What I did was add the RainbowVis-JS library and implement this:
Instead, I'm envisioning something like this:
https://github.com/anomal/RainbowVis-JS
What would be nice would be to let users specify an array of colors, a min, and a max, and have columns in a ListGrid be colored accordingly.
I've implemented something that works for me, but this is something that I would guess that a lot of users would appreciate. What I did was add the RainbowVis-JS library and implement this:
Code:
grid.getCellCSSText = function(record,row,col){ var field = this.getFieldName(col); if(field in coloring){ var value = record[field]; if(value == null) return; var color = coloring[field].colourAt(value); var r = parseInt(color.substring(0,2),16).toString(); var g = parseInt(color.substring(2,4),16).toString(); var b = parseInt(color.substring(4,6),16).toString(); return "background:rgba("+r+","+g+","+b+",0.5)"; } }
Code:
hilites: [ { fieldName: "area", cssType: "background", spectrum: ["red","white","green"], min: -5.0, max: 5.0 }
https://github.com/anomal/RainbowVis-JS
Comment