diff --git a/pom.xml b/pom.xml index 6b1d6df1bc763dcb15a3852077e82ef84b47d392..ff81e5dd21d4848f93433df352225c8105fc4966 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ <groupId>fr.cemagref</groupId> <artifactId>observation</artifactId> - <version>0.1.1</version> + <version>0.1.2</version> <dependencies> <dependency> @@ -62,8 +62,8 @@ <packaging>jar</packaging> <scm> - <connection>scm:svn:http://trac.clermont.cemagref.fr/svn/LISC/Observation/tags/observation-0.1.1</connection> - <url>http://trac.clermont.cemagref.fr/projets/LISC/browser/Observation/tags/observation-0.1.1</url> + <connection>scm:svn:http://trac.clermont.cemagref.fr/svn/LISC/Observation/tags/observation-0.1.2</connection> + <url>http://trac.clermont.cemagref.fr/projets/LISC/browser/Observation/tags/observation-0.1.2</url> </scm> <build> <plugins> diff --git a/src/main/java/fr/cemagref/observation/observers/jfreechart/TemporalChart.java b/src/main/java/fr/cemagref/observation/observers/jfreechart/TemporalChart.java index 709447d5e1771e4a623e0b0dbd6826c464e78845..a6e510d32699d88e1eb5d6658c2a7d3b0725a978 100644 --- a/src/main/java/fr/cemagref/observation/observers/jfreechart/TemporalChart.java +++ b/src/main/java/fr/cemagref/observation/observers/jfreechart/TemporalChart.java @@ -29,7 +29,7 @@ public abstract class TemporalChart implements ObserverListener, Configurable, D */ protected transient ObservablesHandler.ObservableFetcher variable; protected transient ObservablesHandler classObservable; - private String title = "", xAxisLabel = "Time", yAxisLabel = ""; + private String titlePrefix="Observation of ", title = "", xAxisLabel = "Time", yAxisLabel = ""; public TemporalChart() { graphTypeUpdated(); @@ -44,10 +44,18 @@ public abstract class TemporalChart implements ObserverListener, Configurable, D protected void variableUpdated() { if (variable != null) { yAxisLabel = variable.getDescription(); - title = "Observation of " + yAxisLabel; + title = titlePrefix + yAxisLabel; } } + /** + * Modify the prefix used for updating the title. By default, it is "Observation of ". + * @param prefix + */ + protected void setTitlePrefix(String prefix) { + this.titlePrefix = prefix; + } + protected void graphTypeUpdated() { PlotOrientation orientation = PlotOrientation.VERTICAL; boolean legend = true;