Details
-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
None
-
AbstractChartParam InvalidArgumentException Date colon
-
Low
-
N/A
-
N/A
-
Description
I should be able to create a chart with x-axis data points at each minute of the day. Instead an exception is thrown:
Charting exception: Error number 0 in 5: You are attempting to add an observation for the time period 11-February-2001 but the series already contains an observation for that time period. Duplicates are not permitted.
See: http://sandbox.xwiki.org/xwiki/bin/view/Main/ChartTest
The exception is thrown because String[] split = args[i].split(":") results in split.length != 2 in AbstractChartParam.java
My ugly fix was to replace:
if (split.length != 2)
result.put(split[0].trim(), split[1].trim());
with:
if (split.length != 2 && !args[i].startsWith("pattern") && !args[i].startsWith("value"))
if (args[i].startsWith("pattern") || args[i].startsWith("value"))
result.put(split[0].trim(), args[i].substring(args[i].indexOf(MAP_ASSIGNMENT)+1));
else
result.put(split[0].trim(), split[1].trim());
This required jcommon-1.0.10.jar and jfreechart-1.0.6.jar
There must be a better way.