Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{scrollbar}

The

...

Open

...

Flash

...

Chart

...

Component,

...

available

...

in

...

platform

...

version

...

3.0

...

and

...

higher,

...

currently

...

employs

...

Open

...

Flash

...

Charts

...

as

...

its

...

charting

...

engine.

...

Component Name:

...

OpenFlashChartComponent

...

The

...

OpenFlashChartComponent

...

is

...

a

...

BI

...

component

...

that

...

can

...

create

...

a

...

variety

...

of

...

charts

...

including:

...

...

To successfully use this component, you will want to be familiar with the Chart Reference.

Inputs

REQUIRED INPUTS

chart-data

The dataset that you want the chart to render. Often, this is the output of a SQLLookupRule action, but can come from a number of source actions.

chart-attributes

 This defines where the xml chart definition will be resourced from.  It could come from component definition, action sequence input, or action sequence resource.
 Note: the xml chart definition specified in chart attributes also supports parameterization of elements.  This is accomplished by insterting parameter strings (i.e. {INPUT PARAM}) values in the chart xml or input. 

OPTIONAL INPUTS

The following are additional properties that you can specify for the chart as inputs, or as part of the component-definition. Many of these properties duplicate properties that you can set inside of the chart definition (chart-attributes string or XML file). When these duplicate properties are set as inputs or as part of the component-definition, they override any identical property that exists in the chart-attributes. The hierarchical nature of these properties allows you to dynamically set and override a value, yet also have a default in the chart-attributes.

by-row
Indicates if the chart data is to be aggregated along the row dimensions. Default value = false.

width
Sets the chart width in either pixels or percentages. Default value = 100%.

height
Sets the chart height in either pixes or percentages. Default value = 100%.

ofc_lib_name
Provides the ability to override the default .swf by providing the name of an alternate Open Flash Chart .swf file to use. 
Note: you should not change this unless you are a developer familiar with development of Open Flash Charts and/or Pentaho platform components.

ofc_url

Provides the ability to override the default location of the Open Flash Chart .swf file. 

Resources

OPTIONAL RESOURCES

chart_template
The "resource", usually a solution file, to use as the Chart Template. This is typically used so that you can create a file, "mychartdefinition.txt" that contains the Chart Template rather than using a string

Outputs

image-tag
Contains the image-tag of the generated open flash chart data file in the content repository. This is the ChartTemplate mashed up with the data to make the real data file to display in open flash chart.

html_fragment
Contains the HTML fragment that will render the flash chart. This includes a Flash Object fragment of size chart_height x chart_width (from inputs) and a callback location for the open flash chart data file in the content repository.

Example Action Sequence

The following action sequence uses the output from a SQL lookup rule (a Relational data source) as the input for an OpenFlashChartComponent which generates a bar chart.  See the Chart Reference for an explanation of the chart properties.

Code Block
xml
xml
titlesimple_chart.xaction
<?xml version="1.0" encoding="UTF-8"?>
<action-sequence>
  <name>Simple Bar Chart Example</name>
  <title>Simple Bar Chart Example</title>
  <version>1</version>
  <logging-level>DEBUG</logging-level>
  <documentation>
    <author>Jake Cornelius</author>
    <description>This demonstrates generating a simple bar chart types using the OpenFlashChartComponent in an action sequence</description>
    <icon/>
    <help/>
    <result-type/>
  </documentation>

  <inputs>
    <chart_width type="string">
      <sources>
        <request>chart_width</request>
      </sources>
      <default-value><![CDATA[650]]></default-value>
    </chart_width>
    <chart_height type="string">
      <sources>
        <request>chart_height</request>
      </sources>
      <default-value><![CDATA[400]]></default-value>
    </chart_height>
  </inputs>

  <outputs>
    <image-tag type="string"/>
  </outputs>

  <resources>
    <!-- use this section to identify any files that the component needs to execute the report -->
    <bar>
      <solution-file>
        <location>flash_barchart.xml</location>
        <mime-type>text/xml</mime-type>
      </solution-file>
    </bar>
  </resources>

  <actions>
    <action-definition>
      <component-name>SQLLookupRule</component-name>
      <action-type>Chart Data Query</action-type>
      <action-outputs>
        <query-result type="result-set" mapping="query_result"/>
      </action-outputs>
      <component-definition>
        <jndi><![CDATA[SampleData]]></jndi>
        <live><![CDATA[true]]></live>
        <query><![CDATA[SELECT PRODUCTS.PRODUCTLINE AS LINE,
            SUM(CASE ORDERFACT.YEAR_ID WHEN '2003' THEN (ORDERFACT.TOTALPRICE) ELSE 0 END) AS "2003",
            SUM(CASE ORDERFACT.YEAR_ID WHEN '2004' THEN (ORDERFACT.TOTALPRICE) ELSE 0 END) AS "2004",
            SUM(CASE ORDERFACT.YEAR_ID WHEN '2005' THEN (ORDERFACT.TOTALPRICE) ELSE 0 END) AS "2005"
          FROM
            PRODUCTS INNER JOIN ORDERFACT ON PRODUCTS.PRODUCTCODE = ORDERFACT.PRODUCTCODE
            INNER JOIN CUSTOMER_W_TER ON ORDERFACT.CUSTOMERNUMBER = CUSTOMER_W_TER.CUSTOMERNUMBER GROUP BY
            LINE
          ORDER BY
            2 DESC]]></query>
      </component-definition>
    </action-definition>

    <action-definition>
      <component-name>OpenFlashChartComponent</component-name>
      <action-type>Open Flash Chart</action-type>
      <action-inputs>
        <chart-data type="string" mapping="query_result"/>
        <width type="string" mapping="chart_width"/>
        <height type="string" mapping="chart_height"/>
      </action-inputs>
      <action-resources>
        <chart-attributes type="resource" mapping="bar"/>
      </action-resources>
      <action-outputs>
        <image-tag type="string"/>
      </action-outputs>
      <component-definition/>
    </action-definition>

  </actions>
</action-sequence>
{code}

To

...

test

...

this

...

Action

...

Sequence

...

in

...

your

...

Pentaho

...

deployment,

...

simply:

...

  1. Download

...

  1. the

...

  1. attached

...

  1. action

...

  1. sequence

...

  1. (

...

  1. simple_chart.xaction

...

  1. )

...

  1. and

...

  1. chart

...

  1. xml

...

  1. document

...

  1. (

...

  1. flash_barchart.xml

...

  1. )

...

  1. Place

...

  1. them

...

  1. in

...

  1. a

...

  1. valid

...

  1. location

...

  1. within

...

  1. your

...

  1. solution

...

  1. repository

...

  1. (i.e.

...

  1. .\biserver-ce\pentaho-solutions\steel-wheels\charts)

...

  1. Login

...

  1. to

...

  1. the

...

  1. Pentaho

...

  1. User

...

  1. Console

...

  1. as

...

  1. joe/password,

...

  1. make

...

  1. sure

...

  1. to

...

  1. refresh

...

  1. your

...

  1. repository

...

  1. cache

...

  1. by

...

  1. selecting

...

  1. Tools

...

  1. |Reresh

...

  1. |Repository

...

  1. Cache

...

  1. from

...

  1. the

...

  1. menubar

...

  1. Navigate

...

  1. to

...

  1. the

...

  1. location

...

  1. you

...

  1. saved

...

  1. the

...

  1. files

...

  1. and

...

  1. open

...

  1. the

...

  1. 'Simple

...

  1. Bar

...

  1. Chart

...

  1. Example'

...

  1. action

...

  1. sequence:

...

Image Added