Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/FixingsKMChartService.java @ 3166:591be3486087
FixA: Prevent that the plot becomes to small if only one point is drawn.
flys-artifacts/trunk@4779 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 25 Jun 2012 15:03:57 +0000 |
parents | 6d0567a8387d |
children | 79e7bba0f593 |
comparison
equal
deleted
inserted
replaced
3165:6b13d7e7b403 | 3166:591be3486087 |
---|---|
256 plot.setDataset(0, dataset); | 256 plot.setDataset(0, dataset); |
257 | 257 |
258 Rectangle2D area = dataset.getArea(); | 258 Rectangle2D area = dataset.getArea(); |
259 | 259 |
260 if (area != null) { | 260 if (area != null) { |
261 double wInset = area.getHeight() * 0.25d; | 261 double height = area.getHeight(); |
262 log.debug("width: " + area.getWidth()); | 262 double wInset = Math.max(height, 0.01) * 0.25d; |
263 log.debug("height: "+ area.getHeight()); | |
264 | 263 |
265 wA.setAutoRangeIncludesZero(false); | 264 wA.setAutoRangeIncludesZero(false); |
266 wA.setRange(new Range( | 265 wA.setRange(new Range( |
267 area.getMinY() - wInset, | 266 area.getMinY() - wInset, |
268 area.getMaxY() + wInset)); | 267 area.getMaxY() + wInset)); |