Charting
At the moment, the charting capabilities of the reporting engine are strongly underdeveloped. The ChartExpressions can be safely considered a usability nightmare (but to quote Marc: "..., but it works.").
The following draft-specs are based on an analysis of JFreeChart, but can be applied to other chart-engines as well. The chart-engine reuses a couple of ideas that have been originally developed for the reporting engine.
- Use a single, uniform data-source
- Use a clear structural description of how the chart is composed.
- Avoid redundancy, but not at the cost of usability.
- Separate data, structure and style.
Although JFreeChart is a good starting point to collect features for the chart-engine, it is definitly no sane base to build a clean structural guide on how a chart is composed or styled. Therefore I will not tie the engine to the JFreeChart architecture.
High-Level Requirements
- The engine must be able to produce charts for Reports (Graphics2D), the Web (Raster-Images, AJAX, Flash?) and must be able to transform the Pentaho-Chart-Definitions into 3rd Party Chart-Engine definitions (OpenOffice-Charts, maybe Excel)
- The charts must be able to create HyperLinks and/or output-target specific Event-Handlers (for AJAX)
- The chart engine must have a minimal set of dependencies. It must not depend on the Pentaho-Plattform, so that JFreeReport-users who dont use the Plattform are able to use it freely.
- The chart engine must provide extension points so that it can be integrated seamlessly into the Reporting Engine and the Plattform.
- The engine must provide users the option to use their own target-specific datasources (for real-time charts).
Architectural Draft
Data-Source Definition
After carefully analyzing the JFreeChart data-source implementations, it is safe to say: All chart-data sources can be expressed using one or more tables. Each data-item can be treated as a compound-key to compound-value mapping. All additional JFreeChart-datasource constraints can be derived from the given data using one or more simple data-preprocessing steps.