Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java @ 8455:6dfc3a1fc70d
(issue1764) Set upper-time and lower-time for time series axes
This introduces new optional chart settings. Upper-time and
lower-time. If they are present the client can show a date selection
and they can be used for the domain axis in timeseries diagrams.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 29 Oct 2014 19:51:39 +0100 |
parents | e4606eae8ea5 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8454:7003cf5c19ed | 8455:6dfc3a1fc70d |
---|---|
210 String fSize = XMLUtils.xpathString(axis, "font-size", null); | 210 String fSize = XMLUtils.xpathString(axis, "font-size", null); |
211 String fixation = XMLUtils.xpathString(axis, "fixation", null); | 211 String fixation = XMLUtils.xpathString(axis, "fixation", null); |
212 String low = XMLUtils.xpathString(axis, "lower", null); | 212 String low = XMLUtils.xpathString(axis, "lower", null); |
213 String up = XMLUtils.xpathString(axis, "upper", null); | 213 String up = XMLUtils.xpathString(axis, "upper", null); |
214 String sugLabel = XMLUtils.xpathString(axis, "suggested-label", null); | 214 String sugLabel = XMLUtils.xpathString(axis, "suggested-label", null); |
215 String lowTime = XMLUtils.xpathString(axis, "lower-time", null); | |
216 String upTime = XMLUtils.xpathString(axis, "upper-time", null); | |
215 | 217 |
216 if (log.isDebugEnabled()) { | 218 if (log.isDebugEnabled()) { |
217 log.debug("Found axis id: '" + id + "'"); | 219 log.debug("Found axis id: '" + id + "'"); |
218 log.debug("Found axis label: '" + label + "'"); | 220 log.debug("Found axis label: '" + label + "'"); |
219 log.debug("Found axis font size: '" + fSize + "'"); | 221 log.debug("Found axis font size: '" + fSize + "'"); |
220 log.debug("Found axis fixation: '" + fixation + "'"); | 222 log.debug("Found axis fixation: '" + fixation + "'"); |
221 log.debug("Found axis lower: '" + low + "'"); | 223 log.debug("Found axis lower: '" + low + "'"); |
222 log.debug("Found axis upper: '" + up + "'"); | 224 log.debug("Found axis upper: '" + up + "'"); |
225 log.debug("Found axis lower-time:'" + lowTime + "'"); | |
226 log.debug("Found axis upper-time:'" + upTime + "'"); | |
223 log.debug("Found axis sug. label:'" + sugLabel + "'"); | 227 log.debug("Found axis sug. label:'" + sugLabel + "'"); |
224 } | 228 } |
225 | 229 |
226 section.setIdentifier(id); | 230 section.setIdentifier(id); |
227 section.setLabel(label); | 231 section.setLabel(label); |
228 section.setFontSize(Integer.parseInt(fSize.length() > 0 ? fSize : "-1")); | 232 section.setFontSize(Integer.parseInt(fSize.length() > 0 ? fSize : "-1")); |
229 section.setFixed(Boolean.valueOf(fixation)); | 233 section.setFixed(Boolean.valueOf(fixation)); |
230 section.setLowerRange(Double.parseDouble(low.length() > 0 ? low : "0")); | 234 if (upTime != null && !upTime.isEmpty() && lowTime != null && !lowTime.isEmpty()) { |
231 section.setUpperRange(Double.parseDouble(up.length() > 0 ? up : "0")); | 235 section.setLowerTimeRange(Long.parseLong(lowTime)); |
236 section.setUpperTimeRange(Long.parseLong(upTime)); | |
237 } else { | |
238 section.setLowerRange(Double.parseDouble(low.length() > 0 ? low : "0")); | |
239 section.setUpperRange(Double.parseDouble(up.length() > 0 ? up : "0")); | |
240 } | |
232 section.setSuggestedLabel(sugLabel); | 241 section.setSuggestedLabel(sugLabel); |
233 | 242 |
234 target.addAxisSection(section); | 243 target.addAxisSection(section); |
235 } | 244 } |
236 | 245 |