comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java @ 2605:15a3684c6bce

#366 Display correct descriptions in legend panel of charts. flys-artifacts/trunk@4183 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 29 Mar 2012 11:09:26 +0000
parents bece6f604899
children a7a4d3b2e2b0
comparison
equal deleted inserted replaced
2604:83c117b639f9 2605:15a3684c6bce
197 logger.error("No facet given. Cannot create dataset."); 197 logger.error("No facet given. Cannot create dataset.");
198 return; 198 return;
199 } 199 }
200 200
201 if (name.equals(DURATION_W)) { 201 if (name.equals(DURATION_W)) {
202 doWOut((WQDay) artifactFacet.getData(context), attr, visible); 202 doWOut(
203 (WQDay) artifactFacet.getData(context),
204 artifactFacet,
205 attr,
206 visible);
203 } 207 }
204 else if (name.equals(DURATION_Q)) { 208 else if (name.equals(DURATION_Q)) {
205 doQOut((WQDay) artifactFacet.getData(context), attr, visible); 209 doQOut(
210 (WQDay) artifactFacet.getData(context),
211 artifactFacet,
212 attr,
213 visible);
206 } 214 }
207 else if (name.equals(DURATION_MAINVALUES_Q) 215 else if (name.equals(DURATION_MAINVALUES_Q)
208 || name.equals(MAINVALUES_Q) 216 || name.equals(MAINVALUES_Q)
209 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) 217 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W)
210 || name.equals(MAINVALUES_W) 218 || name.equals(MAINVALUES_W)
232 * Creates the series for a duration curve's W facet. 240 * Creates the series for a duration curve's W facet.
233 * 241 *
234 * @param wqdays The WQDay store that contains the Ws. 242 * @param wqdays The WQDay store that contains the Ws.
235 * @param theme 243 * @param theme
236 */ 244 */
237 protected void doWOut(WQDay wqdays, Document theme, boolean visible) { 245 protected void doWOut(
246 WQDay wqdays,
247 ArtifactAndFacet aaf,
248 Document theme,
249 boolean visible
250 ) {
238 logger.debug("DurationCurveGenerator.doWOut"); 251 logger.debug("DurationCurveGenerator.doWOut");
239 252
240 // TODO find the correct series name 253 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
241 XYSeries series = new StyledXYSeries(
242 getSeriesName(getRiverName(), DURATION_W), theme);
243 254
244 int size = wqdays.size(); 255 int size = wqdays.size();
245 for (int i = 0; i < size; i++) { 256 for (int i = 0; i < size; i++) {
246 int day = wqdays.getDay(i); 257 int day = wqdays.getDay(i);
247 double w = wqdays.getW(i); 258 double w = wqdays.getW(i);
257 * Creates the series for a duration curve's Q facet. 268 * Creates the series for a duration curve's Q facet.
258 * 269 *
259 * @param wqdays The WQDay store that contains the Qs. 270 * @param wqdays The WQDay store that contains the Qs.
260 * @param theme 271 * @param theme
261 */ 272 */
262 protected void doQOut(WQDay wqdays, Document theme, boolean visible) { 273 protected void doQOut(
274 WQDay wqdays,
275 ArtifactAndFacet aaf,
276 Document theme,
277 boolean visible
278 ) {
263 logger.debug("DurationCurveGenerator.doQOut"); 279 logger.debug("DurationCurveGenerator.doQOut");
264 280
265 // TODO find the correct series name 281 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
266 XYSeries series = new StyledXYSeries(
267 getSeriesName(getRiverName(), DURATION_Q), theme);
268 282
269 int size = wqdays.size(); 283 int size = wqdays.size();
270 for (int i = 0; i < size; i++) { 284 for (int i = 0; i < size; i++) {
271 int day = wqdays.getDay(i); 285 int day = wqdays.getDay(i);
272 double q = wqdays.getQ(i); 286 double q = wqdays.getQ(i);

http://dive4elements.wald.intevation.org