views:

235

answers:

1

I am using Jfreechart. I have the following code:

TimeSeries t1 = new TimeSeries("EUR/GBP"); t1.add(new TimeSeriesDataItem....);

But my SQL query gives date in String format & value in Double. I want to use TimeSeriesDataItem. Please let me know how to convert my String into TimeSeriesDataItem. Please let me know how to add my double value to TimeSeriesDataItem.

Thanks in Advance, mahesh.

A: 

1) convert your date from String to java.util.Date

2) wrap this Date instance using one of the classes extending RegularTimePeriod. eg. RegularTimePeriod p = new Day (myDate)

3) TimeSeriesDataItem t = new TimeSeriesDataItem (p, a_numeric_value)