Problem adding a FixedMillisecond to a TimeSeries

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
JoshRountree
Posts: 14
Joined: Thu Mar 02, 2006 9:00 pm

Problem adding a FixedMillisecond to a TimeSeries

Post by JoshRountree » Thu Mar 02, 2006 9:05 pm

The program compiles fine but when I try to add a FixedMillisecond to a TimeSeries I get an exception saying it is expecting an instance of org.jfree.data.time.Day

I thought you could add anything that extended RegularTimePeriod.

Thanks

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

Post by david.gilbert » Thu Mar 02, 2006 9:23 pm

There is a TimeSeries constructor that lets you specify the class of time period that you plan to use. This could probably be improved (by registering the class on the first add), but anyway that's how it works right now...
David Gilbert
JFreeChart Project Leader

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

JoshRountree
Posts: 14
Joined: Thu Mar 02, 2006 9:00 pm

Post by JoshRountree » Thu Mar 02, 2006 9:39 pm

Thanks

I needed to instantiate it like this,

TimeSeries s1 = new TimeSeries("time series demo 1", FixedMillisecond.class);

Can anyone explain the FixedMillisecond.class part, does every class have an implicit "class" field?

Locked