fix(tablepanel): change to using two thresholds

fixes #3878
This commit is contained in:
bergquist
2016-02-05 10:03:08 +01:00
parent fcc960e9a2
commit 8ff997594f
6 changed files with 50 additions and 11 deletions

View File

@@ -16,12 +16,12 @@ export class TableRenderer {
getColorForValue(value, style) {
if (!style.thresholds) { return null; }
for (var i = style.thresholds.length - 1; i >= 0 ; i--) {
if (value >= style.thresholds[i]) {
for (var i = style.thresholds.length; i > 0; i--) {
if (value >= style.thresholds[i - 1]) {
return style.colors[i];
}
}
return null;
return _.first(style.colors);
}
defaultCellFormater(v) {