1 | double percentChange = (newValue.doubleValue() ↵ | | 1 | double percentChange = (newValue.doubleValue() ↵
|
2 | / oldValue.doubleValue() - 1.0) * 100.0;↵ | | 2 | / oldValue.doubleValue() - 1.0) * 100.0;↵
|
3 | double shade↵ | | 3 | double shade↵
|
4 | = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255↵ | | 4 | = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255↵
|
5 | : Math.abs(percentChange) * colorPerPercent);↵ | | 5 | : Math.abs(percentChange) * colorPerPercent);↵
|
6 | if (greenForIncrease ↵ | | 6 | if (greenForIncrease ↵
|
7 | && newValue.doubleValue() > oldValue.doubleValue()↵ | | 7 | && newValue.doubleValue() > oldValue.doubleValue()↵
|
8 | || !greenForIncrease && newValue.doubleValue() ↵ | | 8 | || !greenForIncrease && newValue.doubleValue() ↵
|
9 | < oldValue.doubleValue()) {↵ | | 9 | < oldValue.doubleValue()) {↵
|
10 | plot.setSectionPaint(key, new Color(0, (int) shade, 0));↵ | | 10 | plot.setSectionPaint(key, new Color(0, (int) shade, 0));↵
|
11 | }↵ | | 11 | }↵
|
12 | else {↵ | | 12 | else {↵
|
13 | plot.setSectionPaint(key, new Color((int) shade, 0, 0));↵ | | 13 | plot.setSectionPaint(key, new Color((int) shade, 0, 0));↵
|
14 | }↵ | | 14 | }↵
|
15 | if (showDifference) {↵ | | 15 | if (showDifference) {↵
|
16 | | | 16 |
|