363,9 → 363,19 |
{ |
this.usePercentageColor = usePercentageColor; |
//new Approach for percentage color using degrade |
if(usePercentageColor && type != null && percentDefined != null && value != null) |
if(usePercentageColor && type != null) |
{ |
double percentage = type.equals("percentageDefined") ? Double.parseDouble(percentDefined.replace(",",".")) : Double.parseDouble(value.replace(",",".")); |
double percentage = 0; |
if(type.equals("percentageDefined")) |
{ |
if(percentDefined != null) |
percentage = Double.parseDouble(percentDefined.replace(",",".")); |
} |
else |
{ |
if(value != null) |
Double.parseDouble(value.replace(",",".")); |
} |
percentage = percentage / 100.0; |
setBackgroundColorPercentage(getColorGradientForPercentage(percentage)); |
} |