I've written some extensions for reading in chart configurations from XML and feeding data into charts from a variety of objects without writing any new code to do so (again, configuration happens via XML). The extensions are a new package within the meta-jb project on source forge:
http://sourceforge.net/projects/meta-jb/
The overall project does not have updated docs regarding the extensions, but the package.html file and javadocs for the charting package itself are pretty good. I've included the overview contents of the package.html below. Hope some people find it useful.
The extensions have three primary purposes:
- Provide a way to easily transform data into chart Datasets without writing repetitive code for each type of object for which you want to display in a chart. For example, if you want to produce a TimeSeries chart with the number of hits on your web site per day, another with the hits per month, and a third with your average CPU load per hour, you can produce them all with different instances of TimeSeriesDatasetProducer specified via XML. This functionality was originally designed for the cewolf tablib extension to JFreeChart. It implements the de.laures.cewolf.DatasetProducer interface for this purpose. This is why the cewolf.jar file is required for the package.
Provide a way to specify chart configurations in XML, and thus avoid writing repetitive code over and over for different charts in your application(s). I would roughly guess that 80% of the primary configuration options for JFreeChart (different renderers, colors, axes, etc) can be configured via XML. The biggest limitation right now is you cannot specify multiple axes or renderers in XML using the provided <code> ChartContext</code> setup. You can, of course, still do it in code. This capability may be added in the near future, or, if the good folks at the JFreeChart project are kind, a couple of simple calls will be added to the main Plot classes to allow the regular meta-jb XML handling to accomplish it.
Provide some visual enhancements for interacting with charts (i.e. show the focus of the chart). Included focus handlers can
<ul>w
<li>Highlight a whole series (useful with <code>StandardXYItemRenderer</code>)
<li>Draw crosshairs at a single point (also useful with <code>StandardXYItemRenderer </code>)
<li>Highlight a single section within a <code>StackedXYBarRenderer</code> (using a custom subclass).
</ul>
Focusing can also occur from outside the chart. For example, if you display a table of
data and a chart of the data in a split pane, if the user clicks on a row in the table,
you may want to highlight the corresponding item/series/timeframe in the chart.