Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractHistogram.java @ 1107:86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
gnv-artifacts/trunk@1238 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 29 Jun 2010 07:37:36 +0000 |
parents | 79401c871da4 |
children | f953c9a559d8 |
rev | line source |
---|---|
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.chart; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.Locale; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import org.apache.log4j.Logger; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import org.jfree.chart.ChartFactory; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.jfree.chart.ChartTheme; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import org.jfree.chart.JFreeChart; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
1107
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
11 import org.jfree.chart.axis.NumberAxis; |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
12 import org.jfree.chart.axis.TickUnitSource; |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
13 |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import org.jfree.chart.plot.PlotOrientation; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import org.jfree.chart.plot.XYPlot; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
623
65f09139e9b3
Fixed file handle leak when writing meta data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
617
diff
changeset
|
17 import org.jfree.chart.renderer.xy.XYBarRenderer; |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 /** |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
20 * This abstract class defines some methods to adjust chart settings after its |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
21 * creation. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
22 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
23 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 */ |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 public abstract class AbstractHistogram |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 implements Chart |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 { |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
28 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
29 * Logger used for logging with Apache log4j. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
30 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 private Logger logger = Logger.getLogger(AbstractHistogram.class); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
33 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
34 * JFreeChart chart stored at this place after chart creation. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
35 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 protected JFreeChart chart; |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
37 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
38 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
39 * Labels used for chart title, subtitle, axis description. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
40 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 protected ChartLabels labels; |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
42 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
43 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
44 * Theme which is used to adjust the styling of this chart. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
45 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 protected ChartTheme theme; |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
47 |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
48 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
49 * Raw data which should be displayed in the chart. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
50 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 protected Object[] data; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
53 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
54 * Locale object used for i18n support. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
55 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 protected Locale locale; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
59 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
60 * Constructor for creating histogram charts. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
61 * |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
62 * @param labels See {@link #labels} |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
63 * @param data See {@link #data} |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
64 * @param theme See {@link #theme} |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
65 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 public AbstractHistogram( |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 ChartLabels labels, Object[] data, ChartTheme theme |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 ) { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 this.labels = labels; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 this.data = data; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 this.theme = theme; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
75 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
76 * @see de.intevation.gnv.chart.Chart#generateChart() |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
77 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 public JFreeChart generateChart() { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 if (chart != null) |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 return chart; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 chart = ChartFactory.createHistogram( |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 labels.getTitle(), |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 labels.getDomainAxisLabel(), |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 labels.getRangeAxisLabel(), |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 null, |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 PlotOrientation.VERTICAL, |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 true, |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 false, |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 false); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 applyDatasets(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 theme.apply(chart); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 adjustPlot(); |
1107
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
97 adjustDomainAxis(chart); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
98 adjustRangeAxis(chart); |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 return chart; |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
104 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
105 * Method to do some changes in plot settings. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
106 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 protected void adjustPlot() { |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 XYPlot plot = (XYPlot) chart.getPlot(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 renderer.setShadowVisible(false); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 renderer.setSeriesVisibleInLegend(0, false); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 |
1107
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
116 protected void adjustDomainAxis(JFreeChart chart) { |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
117 XYPlot plot = (XYPlot) chart.getPlot(); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
118 NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
119 |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
120 TickUnitSource tus = domainAxis.createStandardTickUnits(locale); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
121 domainAxis.setStandardTickUnits(tus); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
122 } |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
123 |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
124 |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
125 protected void adjustRangeAxis(JFreeChart chart) { |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
126 XYPlot plot = (XYPlot) chart.getPlot(); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
127 NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
128 |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
129 TickUnitSource tus = rangeAxis.createStandardTickUnits(locale); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
130 rangeAxis.setStandardTickUnits(tus); |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
131 } |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
132 |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
133 |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
134 |
86ca3c10523f
Adjust the format of axes labels in histograms corresponding the specified locale (issue316).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
767
diff
changeset
|
135 |
767
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
136 /** |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
137 * This method needs to be implemented by subclasses and should add valid |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
138 * <code>HistogramDataset</code> objects to the created chart. It is called |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
139 * by {@link #generateChart} after chart creation. |
79401c871da4
Added and repaired javadoc in de.intevation.gnv.chart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
623
diff
changeset
|
140 */ |
617
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 protected abstract void applyDatasets(); |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 } |
3d13fa281a7e
Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |