# HG changeset patch # User Sascha L. Teichmann # Date 1332494754 0 # Node ID 664f97b6d48f2a1af0501ab844135243bff12b35 # Parent 538820485945f59ab93da4f4ec21b97943498e76 Applied patch from flys/issue639 flys-artifacts/trunk@4180 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 538820485945 -r 664f97b6d48f flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Mar 22 15:02:07 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Mar 23 09:25:54 2012 +0000 @@ -1,3 +1,10 @@ +2012-03-23 Sascha L. Teichmann + + flys/issue639: Bezugsliniendiagramm,Achsen-Intervall-Skalierung vereinheitlichen + + * src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java: + Render only axis ticks in meters. + 2012-03-22 Felix Wolfsteller * doc/conf/themes.xml: Let hyks have a text orientation in themes. diff -r 538820485945 -r 664f97b6d48f flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java Thu Mar 22 15:02:07 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java Fri Mar 23 09:25:54 2012 +0000 @@ -5,11 +5,16 @@ import org.apache.log4j.Logger; import org.jfree.chart.JFreeChart; -import org.jfree.chart.axis.NumberAxis; + import org.jfree.chart.title.TextTitle; import org.jfree.data.xy.XYSeries; +import org.jfree.chart.axis.ValueAxis; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.axis.NumberTickUnit; +import org.jfree.chart.axis.TickUnits; + import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.flys.artifacts.model.FacetTypes; @@ -19,6 +24,7 @@ import de.intevation.flys.jfree.StyledXYSeries; +import de.intevation.flys.utils.Formatter; /** * An OutGenerator that generates reference curves. @@ -200,6 +206,25 @@ addAxisSeries(series, YAXIS.W.idx, visible); } + protected void setAxisTickUnit(ValueAxis axis) { + TickUnits units = new TickUnits(); + units.add(new NumberTickUnit(1d, Formatter.getWaterlevelW(context))); + axis.setStandardTickUnits(units); + axis.setAutoTickUnitSelection(true); + } + + @Override + protected void localizeDomainAxis(ValueAxis domainAxis) { + super.localizeDomainAxis(domainAxis); + setAxisTickUnit(domainAxis); + } + + + @Override + protected void localizeRangeAxis(ValueAxis rangeAxis) { + super.localizeRangeAxis(rangeAxis); + setAxisTickUnit(rangeAxis); + } /** Get Walker to iterate over all axes. */ @Override