#36 TimeSeriesCollectionHandler

open
nobody
None
5
2012-11-27
2004-03-29
james kelly
No

I've added a TimeSeriesCollectionHandler and
TimeSeriesHandler to org.jfree.data.xml and added two
new readTimeSeriesCollectionFromXML methods to
DatasetReader.

Here's a sample data file:

<?xml version="1.0" encoding="UTF-8"?>
<TimeSeriesCollection>
<Series name = "Series 1"
timeperiodclass="org.jfree.data.time.Day"
format="M/d/yyyy">
<Item>
<Key>1-Jan-03</Key>
<Value>0</Value>
</Item>
<Item>
<Key>2-Jan-03</Key>
<Value>8</Value>
</Item>
<Item>
<Key>3-Jan-03</Key>
<Value>8</Value>
</Item>
<Item>
<Key>4-Jan-03</Key>
<Value>0</Value>
</Item>
<Item>
<Key>5-Jan-03</Key>
<Value>0</Value>
</Item>
<Item>
<Key>6-Jan-03</Key>
<Value>8</Value>
</Item>
<Item>
</Series>

</TimeSeriesCollection>

Discussion

  • james kelly

    james kelly - 2004-03-29

    Jar file containing the modified org.jfree.data.xml package.

     
  • james kelly

    james kelly - 2004-03-29

    Logged In: YES
    user_id=134610

    <Series name = "Series 1"
    timeperiodclass="org.jfree.data.time.Day"
    format="M/d/yyyy">

    ...should be...

    <Series name = "Series 1"
    timeperiodclass="org.jfree.data.time.Day"
    format="d-MMM-yy">

     
  • Rick Oosterholt

    Rick Oosterholt - 2008-05-13

    Logged In: YES
    user_id=1275766
    Originator: NO

    I've added the following code to TimeSeriesHandler to handle empty 'Series' tags correctly:
    // Series contains no <Item> element
    if (key==null && value==null) {
    return;
    }

    The code above is added in addItem(..) function before SimpleDateFormat is used to avoid date parse errors when the
    Series tag doesn't contain an Item tag (which should be ok)...

     

Log in to post a comment.