XML Datasets

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

XML Datasets

Post by Claude Leuchter » Wed Oct 02, 2002 8:49 pm

Since we need to load our Chart-Data from XML-Files, I want to implement Classes like XmlCategoryDataset, XmlXYDataset and perhaps also XmlPieDataset.

If anybody knows an implementation already, I would apreciate, otherwise I would like to pass the implementation to some interested testers.

Claude

David Gilbert

Re: XML Datasets

Post by David Gilbert » Thu Oct 03, 2002 8:46 am

Hi Claude,

I think a standardised XML format for the datasets used in JFreeChart would be a real asset.

I'm not sure if you would need to write specific XmlXXXDataset classes (although that would work)...I was thinking more along the lines of a utility class with methods:

public static CategoryDataset readXMLCategoryDataset(InputStream in);

public static void writeXMLCategoryDataset(CategoryDataset data, OutputStream out);

...and so on with similar methods for the other dataset interfaces.

Of course, the 'read' method above would have to instantiate *some* class that implements the CategoryDataset interface, but it doesn't really matter which class it is.

That's just my thoughts without having tried to implement anything. I wish I had some time to work on this...I'll certainly be happy to do some testing on any code you can contribute.

Regards,

DG.

Claude Leuchter

Re: XML Datasets

Post by Claude Leuchter » Thu Oct 03, 2002 3:42 pm

I can agree with a utility class, if you then move those methods to the Datasets, if they work properly.
I would not like such a util-class stay forever, even if it is the better solution that my proposal.

Claude Leuchter

Re: XML Datasets

Post by Claude Leuchter » Mon Oct 07, 2002 5:52 pm

I sent you a mail, containing my first draft.

Claude

Claude Leuchter

Re: XML Datasets

Post by Claude Leuchter » Mon Oct 14, 2002 1:22 pm

Hi David
have you had a look at the code?

Dave Gilbert

Re: XML Datasets

Post by Dave Gilbert » Mon Oct 14, 2002 3:08 pm

Hi Claude,

Thanks, I have your code. Unfortunately I haven't had time to try it out yet, but I hope to do so before releasing 0.9.4.

Regards,

DG.

Luca Morandini

Re: XML Datasets

Post by Luca Morandini » Tue Oct 15, 2002 3:47 pm

Dave & Claude,

we are in thinking about using XML for both chart definition and chart data, possibily using Cocoon for XML feeding (see http://xml.apache.org/cocoon ).
Is there anyone who has tried something like this ?

Thanks in advance.

Claude Leuchter

Re: XML Datasets

Post by Claude Leuchter » Wed Oct 16, 2002 9:18 pm

Hi Luca

designe a XML Language for Chart definition or data is more or less uncoupled from cocoon.
As far as I see it, modelling Chart Data in XML is quite easy and very useful, since data is changing all the time.
Designing Chart Properties in XML is quite complicated because of the large amount of possibilities and even growing number of features. The use of such a language is not so useful, you normally have a stable set of charts, if you have automated chart generation.

So I vote for keeping it simple and effective in the first version.
When Dave will commit the concept of the XML code, I'll work on it and publish it quickly.

Claude

Soren

Re: XML Datasets

Post by Soren » Fri Oct 18, 2002 9:20 am

Hi,

Just wanted to say that XML support would be a real asset. And I would love to see Chart Properties exposed in XML as well. This would make it so much easier for us non-experts in Java.

Thanks,

Soren

Todd Jenkins

Re: XML Datasets

Post by Todd Jenkins » Sat Oct 19, 2002 2:19 am

I really like using JDom from apache.org when working with XML files. Furthermore, I would suggest a utility class that could not only read XML files and generate charts, but also accept charts and serialize them as XML in an output stream.

-Todd

Dave Gilbert

Re: XML Datasets

Post by Dave Gilbert » Mon Oct 21, 2002 9:06 am

Hi All,

First up, I didn't get a chance to try out Claude's code before releasing 0.9.4, because I need to find out more about XPath first. But I am going to look at it this week.

All the other suggestions are great. I will be doing some work on reading chart definitions from XML, because I need this for embedding charts in JFreeReport. And I'd like to get Claude's dataset formats in, because I can see some applications for that. If anyone else wants to contribute any code, it would be welcome...

Regards,

DG.

Locked