JFreeChart vs. SVG

Hi All,

I am in the process of evaluating 3rd party tools for one of my clients for a new application that will need to produce line graphs showing price trends. The requirement is (at report run time) to allow a user to select from a couple of product categories and/or types, input a date range and generate a typical line graph (like stock prices) to show price trends. I am looking at Integra for Notes and IntelliView (I have experience with IntelliPrintPlus) but due to cost restraints I have been asked to evaluate freeware based solutions. I have done stuff with exporting data to Excel worksheets and using macros to generate reports in the past but have not been very happy with the results and functionality. This forum has led me to many articles on SVG which seems like it should do the trick (sadly I am not very familiar with this technology) and also to JFreeChart (again not familiar and no experience with Java really)

I need to complete this project under some tough schedule deadlines and was wondering if anyone had any input regarding either SVG or JFreeChart or better yet… any working examples they would care to share.

As always… your input is greatly appreciated.

Cheers,

Mark

Subject: JFreeChart vs. SVG

SVG is mind-bogglingly simple for simple charting – it’s just like doing an HTML printback from an agent or a “Treat As HTML” form. Generally, the “file” size is tiny compared to the graphic it describes, and since much of the output can be taken from constants, SVG output agents are generally pretty quick. Both Jake Howlett and myself wrote articles about SVG charting over at Codestore.Net – Jake’s included an agent for bar charting, and mine was simply a method for creating pie charts (and assumed that the reader could assemble the data and write the Print statements all by himself). The only real problem is that you have to rely on the end-user having an SVG viewer installed – it’s a free download, but you can’t count on it being there, so its current suitability for public sites is questionable. For intranet/extranet applications, you can afford to be a bit more demanding of your customers. And SVG is a bit slow if you’re doing complex blends and fades and that sort of thing, so the simpler the better – lines, defined shapes and flat colour will render and scale quickly.

If you haven’t run across it yet, my article is at:

http://codestore.net/store.nsf/unid/EPSD-5DTT4L/

I tried to explain the concepts as I went along, but the biggest part of the article is just the mathematics of creating the pie chart. Jake’s articles (including examples) are here:

http://codestore.net/store.nsf/unid/BLOG-20020611?OpenDocument

and here:

http://codestore.net/store.nsf/unid/EPSD-5B4PLK?OpenDocument

and you can click on the “SVG” keyword for more. There is also a good SVG tutorial at:

http://www.w3schools.com/svg/default.asp

JFreeChart, on the other hand, generates the graphics server-side and serves them in a more universally-supported image format. I’ve never used it in anger on Domino, so I don’t know what kind of performance you’ll get. Perhaps someone else can fill in this part fo the picture?

Subject: RE: JFreeChart vs. SVG

Hey Stan,

Thanks a bunch… I have read both yours and Jake’s articles but I missed the blog entry with the sample. I will review this and comment back here.

In the meantime, I am still interested in the JFreeChart approach as it will likely provide more options in some of my other development.

PS. Guys like you and Jake ought to be commended for all the effort you put into sharing your expertise. A very big and sincere Thank You from me (and going out on a limb) everyone you help out on this forum.

Cheers,

Mark

Subject: RE: JFreeChart vs. SVG

I must learn more about SVG, it sounds interesting.

I have done some stuff with jFreeChart, it is pretty nice, but as you say totally different approach to SVG. Jfreechart is a library of Java classes which you can work with from Java to do all sorts of charting tasks. I have used it to write applets which integrate with Notes data, in particular I did some work with Gantt type layouts which you can have a play with. I have also done composite line chart type things. It is pretty cool stuff, and you can integrate it with other Java tools to save the image as a PNG or PDF (or others but those were the two I was interested in). It works as a server side library too, so you can call it from a servlet or perhaps Java agent and output the results as a png/gif/jpg/whatever direct to the browser. Or have the browser download the applet and have a continuously updating live chart if you like.

Alan.

Subject: RE: JFreeChart vs. SVG

Try “www.jnotes.de/JNotes/jnotes_ webware.nsf/jnotes/Tools_Chart.html”(or do a google search for ChartDemo.nsf). Also check the sandbox.

There is a chart applet which is pretty flexible and might do what you are looking for.

Wayne

Subject: JFreeChart vs. SVG

What I use with great success is totally free

PHP + JPGraph

HTH

Don

Subject: JFreeChart vs. SVG

If you can wait about 10 more days, I’ll be doing a demo of using JFreeChart in a Notes database during the Java for Domino Developers Jumpstart session at Lotusphere (with Tom Duff).

The database will be downloadable, with all source code, so even if you’re not there you’ll be able to download and take a look. The example I’ll definitely be showing is a dynamic 3-D pie chart using JFreeChart, although I might put one or two other graph types in there too.

One nice thing is that my demo doesn’t use an applet at all. First it displays the chart in a Swing frame, then it saves it to the local hard drive as a JPG file, and then it embeds it in the body of an e-mail and sends it to my inbox – just to show that you have some options.

Or, SVG is good too… :slight_smile:

Subject: JFreeChart vs. SVG

Check out http://217.204.16.228/svgdemo.nsf. It’s a SVG demo by Tim Crannigan. The nsf is downloadable and the code is well written with plenty of comments.

Subject: RE: JFreeChart vs. SVG

Hi All,

Thanks for all the great feedback. I think I am going to run with the SVG option. It seems pretty straight forward with enough flexibility to solve the majority of my clients graphing needs. Sad that the support for the viewer is not built in to the browsers yet… but this type of stuff is almost always used in internal apps and I can force my clients to download and install the viewer.

Jordan… this example that Tim did is GREAT! Shows alot of uses and good integration. I recommend it to anyone trying to dive right it. Is there really any other way?

Cheers,

Mark