Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/jfree/DoubleBounds.java @ 5777:e95427ed80e5
Merged
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 21 Apr 2013 10:46:59 +0200 |
parents | e1ba8273df07 |
children |
comparison
equal
deleted
inserted
replaced
5776:1126b9e00378 | 5777:e95427ed80e5 |
---|---|
1 package de.intevation.flys.jfree; | 1 package de.intevation.flys.jfree; |
2 | 2 |
3 | 3 |
4 import org.jfree.chart.axis.ValueAxis; | 4 import org.jfree.chart.axis.ValueAxis; |
5 import org.jfree.chart.axis.LogarithmicAxis; | |
5 import org.jfree.data.Range; | 6 import org.jfree.data.Range; |
6 | 7 |
7 | 8 |
8 /** | 9 /** |
9 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 10 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
48 * thus 10 percent on [0,100] -> [-10,110]. | 49 * thus 10 percent on [0,100] -> [-10,110]. |
49 */ | 50 */ |
50 @Override | 51 @Override |
51 public void applyBounds(ValueAxis axis, int percent) { | 52 public void applyBounds(ValueAxis axis, int percent) { |
52 double space = (upper - lower) / 100 * percent; | 53 double space = (upper - lower) / 100 * percent; |
53 axis.setRange(new Range(lower-space, upper+space)); | 54 if (axis instanceof LogarithmicAxis) { |
55 axis.setRange(new Range(Math.max(lower-space, 0.0001), | |
56 Math.max(upper+space, 0.0002))); | |
57 } else { | |
58 axis.setRange(new Range(lower-space, upper+space)); | |
59 } | |
54 } | 60 } |
55 | 61 |
56 | 62 |
57 @Override | 63 @Override |
58 public Bounds combine(Bounds bounds) { | 64 public Bounds combine(Bounds bounds) { |