comparison flys-artifacts/src/main/java/de/intevation/flys/exports/InfoGeneratorHelper.java @ 663:51172d56e8bc

Only generate an axis element if a axis really exists. flys-artifacts/trunk@2075 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 08 Jun 2011 10:19:23 +0000
parents ab43f36f4af6
children b22f21b173a7
comparison
equal deleted inserted replaced
662:60f24fca574a 663:51172d56e8bc
86 86
87 XYPlot plot = (XYPlot) chart.getPlot(); 87 XYPlot plot = (XYPlot) chart.getPlot();
88 88
89 int dAxisCount = plot.getDomainAxisCount(); 89 int dAxisCount = plot.getDomainAxisCount();
90 for (int i = 0; i < dAxisCount; i++) { 90 for (int i = 0; i < dAxisCount; i++) {
91 Element e = createAxisElement( 91 ValueAxis axis = plot.getDomainAxis(i);
92 cr, plot.getDomainAxis(i), "domain", i); 92 if (axis != null) {
93 93 Element e = createAxisElement(cr, axis, "domain", i);
94 if (e != null) {
95 axes.appendChild(e); 94 axes.appendChild(e);
96 } 95 }
97 } 96 }
98 97
99 int rAxisCount = plot.getRangeAxisCount(); 98 int rAxisCount = plot.getRangeAxisCount();
100 for (int i = 0; i < rAxisCount; i++) { 99 for (int i = 0; i < rAxisCount; i++) {
101 Element e = createAxisElement( 100 ValueAxis axis = plot.getRangeAxis(i);
102 cr, plot.getRangeAxis(i), "range", i); 101 if (axis != null) {
103 102 Element e = createAxisElement(cr, axis, "range", i);
104 if (e != null) {
105 axes.appendChild(e); 103 axes.appendChild(e);
106 } 104 }
107 } 105 }
108 106
109 return axes; 107 return axes;

http://dive4elements.wald.intevation.org