MoioChart: the easy-to-use Java library for charts


A demo of the library showing a pie graph and some function plots.

What is MoioChart?

MoioChart is my Java library to draw function plots, bar graphs, pie graphs, etc.

Why should I use it?

Firstly, because it is very easy to use. For example: Drawable objects such as functions, axes, pies, etc. can be added to or removed from the Chart via the standard Collection methods like add() or removeAll(). Repainting and scaling are fully automatic!

Secondly, because it works on both PCs and palmtop computers. If you need to write some code that works from inside an applet, in a standard desktop application and in your handheld or smartphone then MoioChart will be a good starting point. MoioChart is portable across different graphic toolkits and actually it works on Swing, SuperWaba (a Virtual Machine for handhelds) and SWT (Eclipse's native toolkit).

A Palm Tungsten T3 handheld running MoioChart.

Thirdly, because it works great with function plots. Although MoioChart can display a variety of charts, it is particularly well suited for mathematical functions. For example, if you want to plot a parabola all you need is the following line of code:

jGraph.add(new ParsedFunction("x^2"));

All the parsing and scaling stuff is done automatically, as well as the choice of the best "step" to have both accurate plotting and very fast execution.

Finally, because it is free, Open Source software. It is also well organized and commented, making it easy to modify and extend. Adding new Drawable objects, for example, is trivial: you just have to implement three methods.

Download it!

MoioChart is organized in packages, you can download only the ones you need. Inside each package there's an Eclipse project folder (that can be used in other environments as well), a README file, source code, Jar-packaged ready-to-use libraries, demos and Ant files to rebuild everything.

MoioChart base package (zip).

MoioChart-Swing package (zip): Swing-based MoioChart backend, for the typical application and applet interfaces. You also need the base package to use this.

MoioChart-SuperWaba package (zip, 20 MB): SuperWaba-based MoioChart backend, for handhelds and smartphones. You also need the base package and my SuperWaba libraries to use this.

MoioChart-SwingWT package (zip, 24 MB): this backend uses SwingWT to integrate with the SWT library. This allows all the drawing to be done on native (platform-specific) controls to better integrate with the underlying Operating System. Usually this backend also has better performance than the Swing-based one, but it tends to be less stable because of the SwingWT library which is not yet completely mature. You also need the base package to use this.