TimeSeries series = null;
TimeSeriesCollection seriesCollection = new TimeSeriesCollection();
for (int i = 0; i < values.length; i++)
{
TimeChartValue value = (TimeChartValue) values[i];
if (series == null || !series.getKey().equals(value.getSeries()))
{
if (series != null)
{
seriesCollection.addSeries(series);
}
series = new TimeSeries(value.getSeries(), Second.class);
}
series.add(new Second(value.getTime()), value.getValue());
}
seriesCollection.addSeries(series);
return seriesCollection;