Duplicate series values

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
vyronad
Posts: 5
Joined: Thu Apr 30, 2009 1:29 pm

Duplicate series values

Post by vyronad » Fri May 22, 2009 5:57 am

Hi,

When I tried to add below given values, I get the exception.

X-axis Y-axis
----------------------------------------
091000.180 100.000039999999
091000.180 100.000029999999

Exception:
091000.180 100.000039999999
Exception in thread "main" org.jfree.data.general.SeriesException: You are attempting to add an observation for the time period Thu Jan 01 09:10:00 GMT+05:30 1970 but the series already contains an observation for that time period. Duplicates are not permitted. Try using the addOrUpdate() method.
at org.jfree.data.time.TimeSeries.add(TimeSeries.java:519)
at org.jfree.data.time.TimeSeries.add(TimeSeries.java:562)
at org.jfree.chart.demo.TimeSeriesChartDemo1.createDataset(TimeSeriesChartDemo1.java:158)
at org.jfree.chart.demo.TimeSeriesChartDemo1.createDemoPanel(TimeSeriesChartDemo1.java:190)
at org.jfree.chart.demo.TimeSeriesChartDemo1.<init>(TimeSeriesChartDemo1.java:86)
at org.jfree.chart.demo.TimeSeriesChartDemo1.main(TimeSeriesChartDemo1.java:204)

Thanks and regards,
Veeranna Ronad.
Best,
Veeranna Ronad.
My Blog: http://future-of-economy.blogspot.com

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Duplicate series values

Post by david.gilbert » Fri May 22, 2009 7:41 am

The TimeSeries class won't permit duplicate values for a single time period. But I'm confused - is "091000.180" a date/time value or a number?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

emucho
Posts: 3
Joined: Tue Nov 17, 2009 4:56 pm
antibot: No, of course not.

Re: Duplicate series values

Post by emucho » Thu Dec 03, 2009 6:13 pm

I have the same problem.

¿What can i do?

I can't use a addOrUpdate Method because i will create a chart with repeat periods.

Stimpy
Posts: 2
Joined: Thu Jun 20, 2013 8:55 am
antibot: No, of course not.

Re: Duplicate series values

Post by Stimpy » Thu Jun 20, 2013 11:04 am

Hi guys,

I have the same issue. Maybe this helps:

http://stackoverflow.com/questions/6191 ... sexception

I don't know but several methods of the TimeSeriesDemos are deprecated now. Will they be removed in the future?
Do you know Dave?

Locked