Browse Source

CHART-3954 改善设计器的自定义区间值使用公式时,其邻值背景颜色显示逻辑

bugfix/10.0
Wim.Zhai 6 years ago
parent
commit
46da85b73b
  1. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

6
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -531,12 +531,16 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
double forValue = Double.MAX_VALUE; double forValue = Double.MAX_VALUE;
double backValue = -Double.MAX_VALUE; double backValue = -Double.MAX_VALUE;
for(int i = 0, size = textFieldList.size(); i < size; i++) {// check 是否合格, 然后检查 是否改变颜色, for(int i = 0, size = textFieldList.size(); i < size; i++) {// check 是否合格, 然后检查 是否改变颜色,
//backNumber是否是公式形式
boolean formulaBackNumber = false;
if(i == size - 1) { if(i == size - 1) {
backValue = -Double.MAX_VALUE; backValue = -Double.MAX_VALUE;
} else { } else {
Number backNumber = ChartBaseUtils.formula2Number(BaseFormula.createFormulaBuilder().build(getValue4Index(i+1))); Number backNumber = ChartBaseUtils.formula2Number(BaseFormula.createFormulaBuilder().build(getValue4Index(i+1)));
if(backNumber != null){ if(backNumber != null){
backValue = backNumber.doubleValue(); backValue = backNumber.doubleValue();
} else {
formulaBackNumber = true;
} }
} }
@ -544,7 +548,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
if(number != null) { if(number != null) {
double value = number.doubleValue(); double value = number.doubleValue();
if(value < forValue && value > backValue) { if ((value < forValue && value > backValue) || formulaBackNumber) {
setBackgroundUIColor(i,Color.WHITE); setBackgroundUIColor(i,Color.WHITE);
} else { } else {
setBackgroundUIColor(i, Color.red); setBackgroundUIColor(i, Color.red);

Loading…
Cancel
Save