File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java
|
Method name: JFreeChart createPieChart(String, PieDataset, PieDataset, int, boolean, boolean, boolean, Locale, boolean, boolean)
|
|
Method name: JFreeChart createPieChart(String, PieDataset, PieDataset, int, boolean, boolean, boolean, boolean, boolean, boolean)
|
Number of AST nodes: 13
|
|
Number of AST nodes: 13
|
|
1 | Comparable key = (Comparable) it.next();↵ | | 1 | Comparable key = (Comparable) it.next();↵
|
2 | Number newValue = dataset.getValue(key);↵ | | 2 | Number newValue = dataset.getValue(key);↵
|
3 | Number oldValue = previousDataset.getValue(key);↵ | | 3 | Number oldValue = previousDataset.getValue(key);↵
|
|
4 | if (oldValue == null) {↵ | | 4 | if (oldValue == null) {↵
|
5 | if (greenForIncrease) {↵ | | 5 | if (greenForIncrease) {↵
|
6 | plot.setSectionPaint(key, Color.green);↵ | | 6 | plot.setSectionPaint(key, Color.green);↵
|
7 | } ↵ | | 7 | } ↵
|
8 | else {↵ | | 8 | else {↵
|
9 | plot.setSectionPaint(key, Color.red);↵ | | 9 | plot.setSectionPaint(key, Color.red);↵
|
10 | }↵ | | 10 | }↵
|
11 | if (showDifference) {↵ | | 11 | if (showDifference) {↵
|
12 | series.setValue(key + " (+100%)", newValue);↵ | | 12 | series.setValue(key + " (+100%)", newValue);↵
|
13 | }↵ | | 13 | }↵
|
14 | }↵ | | 14 | }↵
|
15 | else {↵ | | 15 | else {↵
|
16 | double percentChange = (newValue.doubleValue() ↵ | | 16 | double percentChange = (newValue.doubleValue() ↵
|
17 | / oldValue.doubleValue() - 1.0) * 100.0;↵ | | 17 | / oldValue.doubleValue() - 1.0) * 100.0;↵
|
18 | double shade↵ | | 18 | double shade↵
|
19 | = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255↵ | | 19 | = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255↵
|
20 | : Math.abs(percentChange) * colorPerPercent);↵ | | 20 | : Math.abs(percentChange) * colorPerPercent);↵
|
21 | if (greenForIncrease ↵ | | 21 | if (greenForIncrease ↵
|
22 | && newValue.doubleValue() > oldValue.doubleValue()↵ | | 22 | && newValue.doubleValue() > oldValue.doubleValue()↵
|
23 | || !greenForIncrease && newValue.doubleValue() ↵ | | 23 | || !greenForIncrease && newValue.doubleValue() ↵
|
24 | < oldValue.doubleValue()) {↵ | | 24 | < oldValue.doubleValue()) {↵
|
25 | plot.setSectionPaint(key, new Color(0, (int) shade, 0));↵ | | 25 | plot.setSectionPaint(key, new Color(0, (int) shade, 0));↵
|
26 | }↵ | | 26 | }↵
|
27 | else {↵ | | 27 | else {↵
|
28 | plot.setSectionPaint(key, new Color((int) shade, 0, 0));↵ | | 28 | plot.setSectionPaint(key, new Color((int) shade, 0, 0));↵
|
29 | } | | 29 | }
|