adding date to timeseries

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Yogesh

adding date to timeseries

Post by Yogesh » Wed Jun 01, 2005 3:03 pm

I have a problem with timeseries. I have a document that contains
information on how to add data to timeseries (for month, hour etc)
but if i just wanna to add Date. how could i do that?
for ex.
It is given in your eg. as
TimeSeries s1 = new TimeSeries("L&G European Index Trust", Month.class);
s1.add(new Month(2, 2001), 181.8 );

now can i have something like this
TimeSeries s1 = new TimeSeries("L&G European Index Trust", java.util.Date.class );
s1.add(mydateobject, 181.8 );

Please reply ASAP as my project is stuck because of this

Yogesh

Re: adding date to timeseries

Post by Yogesh » Thu Jun 02, 2005 8:07 am

I got the solution for this problem and it is working now I used "Day"
class and passed the date object to it. It is working fine, I referred to the
documentation of jfree and its very helpful.
8)
Yogesh wrote:I have a problem with timeseries. I have a document that contains
information on how to add data to timeseries (for month, hour etc)
but if i just wanna to add Date. how could i do that?
for ex.
It is given in your eg. as
TimeSeries s1 = new TimeSeries("L&G European Index Trust", Month.class);
s1.add(new Month(2, 2001), 181.8 );

now can i have something like this
TimeSeries s1 = new TimeSeries("L&G European Index Trust", java.util.Date.class );
s1.add(mydateobject, 181.8 );

Please reply ASAP as my project is stuck because of this

fmgonzales

Post by fmgonzales » Fri Jul 15, 2005 11:56 pm

Can I see that code segment

kevdev
Posts: 3
Joined: Fri Jul 15, 2005 1:30 pm

Post by kevdev » Mon Jul 18, 2005 10:11 am

I used the millisecond class as i wanted to add a new java.util.Date.
The java.util.Date reutrns a Date object to the nearest millisecond.

TimeSeries ts = new TimeSeries("new series", Millisecond.class);
ts.add(new Millisecond(java.util.Date object), 1234);

Works fine for me!

Locked