org.pentaho.platform.plugin.action.chartbeans
Class ChartComponent

java.lang.Object
  extended by org.pentaho.platform.plugin.action.chartbeans.ChartComponent

public class ChartComponent
extends Object

This is a bean that permits easy access to the ChartBeans functionality and was specifically designed to be run from within the Pentaho Platform as an Action Sequence Component.

Author:
cboyden

Constructor Summary
ChartComponent()
           
 
Method Summary
 boolean execute()
          Called to process the chart definition and data set to produce a usable chart.
 String getChartEngine()
          Get the chart engine that the resulting chart was created through
 boolean getConvertNullsToZero()
           
 String getMimeType()
          Fetch the desired MimeType
 String getSwfName()
           
 String getSwfPath()
           
 void setCategoryColumn(String categoryCol)
          Define the column in the data set that contains the Category data
 void setChartData(org.pentaho.commons.connection.IPentahoResultSet chartDataSet)
          Define the data set that will populate the chart
 void setChartEngine(String chartEngine)
          Set the chart engine to render the chart
 void setChartHeight(int chartHeight)
          Set the height of the chart in units specific to the ChartPlugin
 void setChartHeight(String chartHeight)
          Set the height of the chart in units specific to the ChartPlugin
 void setChartModel(org.pentaho.chart.model.ChartModel chartModel)
          Set the ChartModel
 void setChartModelJson(String chartModelJson)
          Set the JSON representation of the ChartModel
 void setChartModelXml(String chartModelXml)
          Set the XML representation of the ChartModel
 void setChartWidth(int chartWidth)
          Set the width of the chart in units specific to the ChartPlugin
 void setChartWidth(String chartWidth)
          Set the width of the chart in units specific to the ChartPlugin
 void setContentLinkingTemplate(String template)
           
 void setConvertNullsToZero(boolean convert)
           
 void setOutputStream(OutputStream outStream)
          Define the OutputStream to which the resulting chart shall be written
 void setOutputType(String outputType)
           
 void setScalingFactor(Double scalingFactor)
           
 void setSeriesColumn(String seriesCol)
          Define the column in the data set that contains the Series/Domain data
 void setValueColumn(String valueCol)
          Define the column in the data set that contains the Value/Range data
 boolean validate()
          Validate the current settings of the ChartComponent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartComponent

public ChartComponent()
Method Detail

execute

public boolean execute()
                throws ChartBootException,
                       org.pentaho.chart.plugin.ChartProcessingException,
                       org.pentaho.reporting.libraries.resourceloader.ResourceException,
                       org.pentaho.chart.InvalidChartDefinition,
                       IOException,
                       org.pentaho.chart.plugin.api.PersistenceException
Called to process the chart definition and data set to produce a usable chart.

Returns:
state of execution. 'true' if execution was successful, otherwise false.
Throws:
ChartBootException
org.pentaho.chart.plugin.ChartProcessingException
org.pentaho.reporting.libraries.resourceloader.ResourceException
org.pentaho.chart.InvalidChartDefinition
IOException
org.pentaho.chart.plugin.api.PersistenceException

setOutputStream

public void setOutputStream(OutputStream outStream)
Define the OutputStream to which the resulting chart shall be written

Parameters:
outStream - Stream receive the chart

setChartData

public void setChartData(org.pentaho.commons.connection.IPentahoResultSet chartDataSet)
Define the data set that will populate the chart

Parameters:
chartDataSet - data set for charting

validate

public boolean validate()
                 throws Exception
Validate the current settings of the ChartComponent. If validate() returns true, then execute may be called. If validate() returns false, a call to execute() is guaranteed to fail.

Returns:
state of validation
Throws:
Exception

setSeriesColumn

public void setSeriesColumn(String seriesCol)
Define the column in the data set that contains the Series/Domain data

Parameters:
seriesCol - name of column that contains the Series/Domain for the chart

setConvertNullsToZero

public void setConvertNullsToZero(boolean convert)

getConvertNullsToZero

public boolean getConvertNullsToZero()

setCategoryColumn

public void setCategoryColumn(String categoryCol)
Define the column in the data set that contains the Category data

Parameters:
seriesCol - name of column that contains the Category for the chart

setValueColumn

public void setValueColumn(String valueCol)
Define the column in the data set that contains the Value/Range data

Parameters:
seriesCol - name of column that contains the Value/Range for the chart

getMimeType

public String getMimeType()
Fetch the desired MimeType

Returns:
mime type

setChartModelJson

public void setChartModelJson(String chartModelJson)
Set the JSON representation of the ChartModel

Parameters:
chartModelJson - JSON serialized representation of the ChartModel

setChartModelXml

public void setChartModelXml(String chartModelXml)
Set the XML representation of the ChartModel

Parameters:
chartStyleXml - XML serialized representation of the ChartModel

setChartModel

public void setChartModel(org.pentaho.chart.model.ChartModel chartModel)
Set the ChartModel

Parameters:
chartModel - model of the chart to be generated

setChartWidth

public void setChartWidth(int chartWidth)
Set the width of the chart in units specific to the ChartPlugin

Parameters:
chartWidth - width of the chart

setChartHeight

public void setChartHeight(int chartHeight)
Set the height of the chart in units specific to the ChartPlugin

Parameters:
chartHeight - height of the chart

setChartWidth

public void setChartWidth(String chartWidth)
Set the width of the chart in units specific to the ChartPlugin

Parameters:
chartWidth - width of the chart

setChartHeight

public void setChartHeight(String chartHeight)
Set the height of the chart in units specific to the ChartPlugin

Parameters:
chartHeight - height of the chart

getChartEngine

public String getChartEngine()
Get the chart engine that the resulting chart was created through

Returns:

setChartEngine

public void setChartEngine(String chartEngine)
Set the chart engine to render the chart

Parameters:
chartEngine - Value of "JFreeChart" or "OpenFlashChart"

setOutputType

public void setOutputType(String outputType)

setScalingFactor

public void setScalingFactor(Double scalingFactor)

getSwfPath

public String getSwfPath()

getSwfName

public String getSwfName()

setContentLinkingTemplate

public void setContentLinkingTemplate(String template)