View Full Version : PentahoFlashChart: Basics

01-08-2009, 09:00 PM
PentahoFlashChart (http://code.google.com/p/pentahoflashcharts/) is a component built for Pentaho 2.0.stable (or Enterprise Edition) that allows you to render flash charts in the User Console and Dashboards. It uses the flash library “Open Flash Chart 2.0 (http://teethgrinder.co.uk/open-flash-chart-2/)” which is an LGPL licensed SWF. The charts are NOT available for rendering in Pentaho Reporting or Pentaho Report Designer.
Let’s first understand what we’re talking about: Consider the following example run (http://demo.bayontechnologies.com/pentaho/ViewAction?solution=openflashchart&path=charts&action=ofc_linechart.xaction&userid=guest&password=guest) from Bayon’s ‘demo’ server.
NOTE: This demo server is not a 100% uptime server - if you don’t see anything above don’t worry. Check back later.
A chart can be rendered via a URL:
http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081053-tm.jpg (http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081053.jpg)
via the Pentaho User Console:
http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081054-tm.jpg (http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081054.jpg)
via Dashboards (JSP/AJAX/CDF):
http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081055-tm.jpg (http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081055.jpg)
The PentahoFlashChart component is intended to be used, like any other component, from an .xaction which is created in the Pentaho Design Studio.
You can follow download this example here: ofc_linechart.xaction (http://pentahoflashcharts.googlecode.com/svn/trunk/solutions/openflashchart/charts/ofc_linechart.xaction)
Just like any chart or report, you have to get your data for reporting. In this case, we’re getting a Relational data set from the Pentaho SampleData data source.
http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081059-tm.jpg (http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081059.jpg)
We also have a “chart template” which is an XML document VERY similar (same same but different) to the pentaho chart xml definition that defines how to build the chart. It contains things like chart tile, chart type, etc. The “chart template” is really where most of the “interesting” work occurs.
LineChartLine Chart–Product “1948 Porsche 356-A Roadster”100020000DaySold Price100010000#909090
Notice that this chart template has a LineChart which means that the component will output a LineChart in Open Flash Chart. The full scope of the tags, and all their functioning is beyond the scope of this intro article and it should also change. The next release of PentahoFlashChart should be 100% compatible with the Pentaho Chart XML definition. We’ll see. http://www.nicholasgoodman.com/bt/blog/wp-includes/images/smilies/icon_smile.gif
This renders the flash fragment to the page, with a “callback” for the data file that has been added to the content repository.
Consider installing it into Pentaho 2.0.stable and playing with it. The sample solution comes with 11 Examples so it should be relatively easy to get going, even though it lacks good documentation.
http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081110-tm.jpg (http://www.nicholasgoodman.com/bt/blog/wp-content/uploads/2009/01/200901081110.jpg)
It’s great for dashboards, and produces some great looking (if not limited) charts.

More... (http://www.nicholasgoodman.com/bt/blog/2009/01/08/pentahoflashchart-basics-2/)