fixed thresholds
This commit is contained in:
parent
751220272e
commit
987728d025
1 changed files with 4 additions and 3 deletions
|
@ -51,13 +51,14 @@ final class IndicatorData {
|
||||||
}
|
}
|
||||||
|
|
||||||
static final int getColorIndex(final IndicatorData indicatorData, final double value) {
|
static final int getColorIndex(final IndicatorData indicatorData, final double value) {
|
||||||
for (int j = 0; j < indicatorData.thresholdColor.length; j++) {
|
final int top = indicatorData.thresholdColor.length - 1;
|
||||||
if (value > indicatorData.thresholdColor[j].value && value < indicatorData.thresholdColor[j].value) {
|
for (int j = 0; j < top; j++) {
|
||||||
|
if (value > indicatorData.thresholdColor[j].value && value < indicatorData.thresholdColor[j + 1].value) {
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return top;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final class ThresholdColor {
|
static final class ThresholdColor {
|
||||||
|
|
Loading…
Reference in a new issue