Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 3621:6772e9f9b65f
Deal with inverted axes in longitudinal charts and logos.
flys-artifacts/trunk@5297 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 29 Aug 2012 14:43:26 +0000 |
parents | 1cd6114603d9 |
children | 119b8ba2b77f |
comparison
equal
deleted
inserted
replaced
3620:1cd6114603d9 | 3621:6772e9f9b65f |
---|---|
250 | 250 |
251 return chart; | 251 return chart; |
252 } | 252 } |
253 | 253 |
254 | 254 |
255 /** | |
256 * Return left most data points x value (on first axis). | |
257 * Shortcut, especially to be overridden in (LS) charts where | |
258 * axis could be inverted. | |
259 */ | |
260 protected double getLeftX() { | |
261 return (Double)getXBounds(0).getLower(); | |
262 } | |
263 | |
264 | |
265 /** | |
266 * Return right most data points x value (on first axis). | |
267 * Shortcut, especially to be overridden in (LS) charts where | |
268 * axis could be inverted. | |
269 */ | |
270 protected double getRightX() { | |
271 return (Double)getXBounds(0).getUpper(); | |
272 } | |
273 | |
274 | |
255 /** Add a logo as background annotation to plot. */ | 275 /** Add a logo as background annotation to plot. */ |
256 protected void addLogo(XYPlot plot) { | 276 protected void addLogo(XYPlot plot) { |
257 String logo = showLogo(); | 277 String logo = showLogo(); |
258 if (logo == null) { | 278 if (logo == null) { |
259 logger.debug("No logo to show chosen"); | 279 logger.debug("No logo to show chosen"); |
294 | 314 |
295 if (placeh == null || placeh.equals("none")) { | 315 if (placeh == null || placeh.equals("none")) { |
296 placeh = "center"; | 316 placeh = "center"; |
297 } | 317 } |
298 if (placeh.equals("left")) { | 318 if (placeh.equals("left")) { |
299 xPos = (Double)getXBounds(0).getLower(); | 319 xPos = getLeftX(); |
300 } | 320 } |
301 else if (placeh.equals("right")) { | 321 else if (placeh.equals("right")) { |
302 xPos = (Double)getXBounds(0).getUpper(); | 322 xPos = getRightX(); |
303 } | 323 } |
304 else if (placeh.equals("center")) { | 324 else if (placeh.equals("center")) { |
305 xPos = ((Double)getXBounds(0).getUpper() + (Double)getXBounds(0).getLower())/2d; | 325 xPos = ((Double)getXBounds(0).getUpper() + (Double)getXBounds(0).getLower())/2d; |
306 } | 326 } |
307 else { | 327 else { |