PentahoFlashChart: Basics

PentahoFlashChart 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” 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 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:

200901081053

via the Pentaho User Console:

200901081054

via Dashboards (JSP/AJAX/CDF):

200901081055

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

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.

200901081059

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.

<chart><chart-type>LineChart</chart-type><title>Line Chart–Product “1948 Porsche 356-A Roadster”</title><x-steps>1000</x-steps><x-max>20000</x-max><domain-title>Day</domain-title><range-title>Sold Price</range-title><y-axis><labels></labels><y-steps>1000</y-steps><y-max>10000</y-max><color>#909090</color></y-axis></chart>

Notice that this chart template has a <chart-type>LineChart</chart-type> 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. 🙂

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.

200901081110

It’s great for dashboards, and produces some great looking (if not limited) charts.

7 thoughts on “PentahoFlashChart: Basics

  1. shyam

    hi nick,

    i am trying to implements opn flash chart in pentaho

    1) i am using pentaho 2.0
    2) i downloaded the pentahoopenflashzip from the following url
    http://code.google.com/p/pentahoflashcharts/wiki/GettingStarted
    3) i unzipped it and i copied the swf file into pentaho-stle/images
    4) i copied the jar into pentaho/web-inf/lib
    i refreshed and restarted the server then i am getting the following error when i am clicking on the action classes in solution repository

    java.lang.NoClassDefFoundError: org/pentaho/plugin/jfreechart/ChartComponent

    Actually in the document i am unable to trace out the following jars can u help me where can i get the below 2 jars
    1) xstream-1.3.jar 2) ofc4j105.jar

    Reply
  2. mohan

    Hi Nicholas,

    I am facing same problem as shyam is facing problem. please help me , where do i can get ofc4j105.jar. I got xstream -1.3.jar.

    Thanks
    mohan

    Reply
  3. Kevin

    I’m encountering an error when using an OpenFlashChart xaction within CDF. I’m using Pentaho PCI (open edition) stable verion 3.0 on Win XP.

    Error below:

    Open Flash Chart

    JSON Parse Error [Syntax Error]
    Error at character 0, line 1:

    0: GenericServlet.ERROR_0002 – Could not get content generator: data-file

    Reply
  4. Caio Moreno de Souza

    Hello folks,

    I had the same problem with open flash chart that Kevin talked about it.

    The error is:

    ———————————————————————–
    Open Flash Chart

    JSON Parse Error [Syntax Error]
    Error at character 0, line 1:

    0: GenericServlet.ERROR_0002 – Could not get content generator: data-file
    ———————————————————————–

    I did not work with Internet Explorer just with Firefox.

    The problem is Firefox.

    Reply
  5. Sergey

    Hello.

    Looks like the project on google code is deprecated. But I am very interested where can I find the source code if openflashchart branch used in pentaho reporting. I search through pentaho svn but there no single AS3 file only java. Yes, I mean flex sources not java API.

    Thanks a lot.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *