...
The resource reference name in the chart component must be chart-attributes. The XML in the file is the chart-attribute XML you would find as an input or as a part of the component definition, starting with a root node of <chart-attributes>. PentahoDoc:Click here for an example of a file containing valid chart-attribute XML.
...
- CHART_OUTPUT (<chart-output type="content"/>)
- Stores the chart in the content repository for use in a subsequent action or process, or displays if the output destination is response and the name is content.
- CHART_FILE_NAME_OUTPUT (<chart-filename type="string"/>)
- Returns the name of the chart file, including the file extension (with no path information) as a String.
- HTML_MAPPING_OUTPUT (<chart-mapping type="string"/>)
- Returns the name of the file that the map has been saved to, including the file extension (with no path information) as a String.
- HTML_MAPPING_HTML (<chart-map-html type="string"/>)
- Returns the chart image map HTML as a String.
- BASE_URL_OUTPUT (<base-url type="string"/>)
- Returns the web app's base URL (ie., http://localhost:8080/pentaho) as a String.
- HTML_IMG_TAG (<image-tag type="string"/>)
- Returns an HTML snippet including the image map, image (<IMG />) tag for the chart image with src, width, height and usemap attributes defined.
- If "image-tag=" appears in the the chart output, include "wrapper=false" in the URL to remove it.
Example Action Sequence
The following action sequence uses the output from a SQL lookup rule ( a Relational data source) as the input for a ChartComponent. See the Chart Properties Reference for an explanation of the chart properties.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<action-sequence> <name>Chart.xaction</name> <title>Default Title</title> <version>1</version> <logging-level>DEBUG</logging-level> <documentation> <author>William E. Seyler</author> <description>Default Description</description> <icon>JFree-quadrant-budget-hsql.png</icon> <help>Help</help> <result-type>rule</result-type> </documentation> <inputs> <chart-type type="string"> <default-value>.png</default-value> <sources> <request>type</request> </sources> </chart-type> </inputs> <actions> <action-definition> <action-outputs> <result-set type="list" /> </action-outputs> <component-name>SQLLookupRule</component-name> <action-type>rule</action-type> <component-definition> <source>sql</source> <live>true</live> <jndi>SampleData</jndi> <query> <![CDATA[select QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT, QUADRANT_ACTUALS.POSITIONTITLE, QUADRANT_ACTUALS.ACTUAL, QUADRANT_ACTUALS.BUDGET from QUADRANT_ACTUALS order by QUADRANT_ACTUALS.REGION,QUADRANT_ACTUALS.DEPARTMENT]]> </query> </component-definition> </action-definition> <action-definition> <action-inputs> <output-type type="string" mapping="chart-type" /> <result-output type="file" /> <chart-data type="list" mapping="result-set" /> </action-inputs> <action-outputs> <chart-output type="string" /> <base-url type="string" /> </action-outputs> <component-name>ChartComponent</component-name> <action-type>report</action-type> <component-definition> <by-row>false</by-row> <chart-attributes> <chart-type>PieChart</chart-type> <title>Actual vs Budget by Region</title> <title-position>TOP</title-position> <title-font> <font-family>Serif</font-family> <size>36</size> <is-bold>false</is-bold> <is-italic>false</is-italic> </title-font> <range-title>US Dollars</range-title> <chart-background type="color">#FFFFFF</chart-background> <plot-background type="color">#FF0000</plot-background> <orientation>Horizontal</orientation> <height>400</height> <width>800</width> <is-3D>true</is-3D> <is-stacked>false</is-stacked> <category-label-rotation>90</category-label-rotation> <border-visible>false</border-visible> <border-paint>#3399FF</border-paint> <include-legend>true</include-legend> </chart-attributes> </component-definition> </action-definition> </actions> </action-sequence> |
...