Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 4650:31327b3b2455
XYChartGenerator: Avoid "range merging" for area series, as these might extend
to fake "infinity" in case of showing an area "above axis". Explain this in code
and remove a TODO.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 06 Dec 2012 13:10:27 +0100 |
parents | 4a30d1d62caf |
children | b195fede1c3b |
comparison
equal
deleted
inserted
replaced
4649:64664e8244ff | 4650:31327b3b2455 |
---|---|
128 | 128 |
129 /** Add a Dataset that describes an area. */ | 129 /** Add a Dataset that describes an area. */ |
130 public void addArea(StyledAreaSeriesCollection series) { | 130 public void addArea(StyledAreaSeriesCollection series) { |
131 this.datasets.add(series); | 131 this.datasets.add(series); |
132 List<?> allSeries = series.getSeries(); | 132 List<?> allSeries = series.getSeries(); |
133 for (int n = 0; n < allSeries.size(); n++) { | 133 /* We do not include the bounds/ranges, if the area includes |
134 includeYRange((XYSeries)allSeries.get(n)); | 134 * points at "infinity"/BIG_DOUBLE_VALUE, the charts extents are |
135 } | 135 * expanded to include these very small/big value. |
136 * This is especially used when showing "area above axis". */ | |
136 } | 137 } |
137 | 138 |
138 /** True if to be rendered as area. */ | 139 /** True if to be rendered as area. */ |
139 @Override | 140 @Override |
140 public boolean isArea(XYDataset series) { | 141 public boolean isArea(XYDataset series) { |
467 | 468 |
468 if (visible) { | 469 if (visible) { |
469 axisDataset.addArea(area); | 470 axisDataset.addArea(area); |
470 } | 471 } |
471 else { | 472 else { |
472 // TODO only range merging. | 473 /* No range merging, for areas extending to infinity this |
473 } | 474 * causes problems. */ |
474 //TODO range merging. | 475 } |
475 } | 476 } |
476 | 477 |
477 | 478 |
478 /** | 479 /** |
479 * Add given series if visible, if not visible adjust ranges (such that | 480 * Add given series if visible, if not visible adjust ranges (such that |