public class ChartAction extends Object implements IStreamingAction
ChartComponent
by cboyden
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 Action.Modifier and Type | Field and Description |
---|---|
protected Exception |
bootException |
protected int |
categoryColumn |
protected String |
categoryColumnName |
protected OutputStream |
chartContentStream |
protected org.pentaho.commons.connection.IPentahoResultSet |
chartData |
protected String |
chartEngine |
protected int |
chartHeight |
protected org.pentaho.chart.model.ChartModel |
chartModel |
protected String |
chartModelJson |
protected String |
chartModelXml |
protected int |
chartWidth |
protected String |
contentLinkingTemplate |
protected boolean |
convertNullsToZero |
protected static int |
DEFAULT_CHART_HEIGHT |
protected static int |
DEFAULT_CHART_WIDTH |
protected String |
outputType |
protected Number |
scalingFactor |
protected int |
seriesColumn |
protected String |
seriesColumnName |
protected String |
title |
protected int |
valueColumn |
protected String |
valueColumnName |
Constructor and Description |
---|
ChartAction() |
Modifier and Type | Method and Description |
---|---|
void |
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(String streamPropertyName) |
protected org.pentaho.chart.plugin.api.IOutput.OutputTypes |
getOutputType()
Fetch the desired output type
|
String |
getSwfName() |
String |
getSwfPath() |
protected void |
loadChartEngine()
Sets the chart engine based on the order of precedence: 1) Chart Definition 2) Action Sequence 3) System Setting 4)
Hard Coded
|
protected void |
loadChartModel() |
protected Object[][] |
processChartData(org.pentaho.commons.connection.IPentahoResultSet resultSet,
int valueColumnIndex)
Transform the IPentahoResultSet into the data format suitable for chart creation.
|
void |
setCategoryColumn(String categoryCol)
Define the column in the data set that contains the Category data
|
void |
setChartContentStream(OutputStream outStream)
Define the OutputStream to which the resulting chart shall be written
|
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 |
setChartModelXmlStream(InputStream chartModelStream)
Set the XML representation of the ChartModel as an InputStream
|
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 outputStream) |
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
|
void |
validate()
Validate the current settings of the ChartAction.
|
protected static final int DEFAULT_CHART_WIDTH
protected static final int DEFAULT_CHART_HEIGHT
protected boolean convertNullsToZero
protected String seriesColumnName
protected int seriesColumn
protected String categoryColumnName
protected int categoryColumn
protected String valueColumnName
protected int valueColumn
protected org.pentaho.commons.connection.IPentahoResultSet chartData
protected String chartEngine
protected Exception bootException
protected String outputType
protected int chartWidth
protected int chartHeight
protected String contentLinkingTemplate
protected Number scalingFactor
protected OutputStream chartContentStream
protected String chartModelJson
protected String chartModelXml
protected org.pentaho.chart.model.ChartModel chartModel
protected String title
public void execute() throws Exception
execute
in interface IAction
ChartBootException
ChartProcessingException
ResourceException
InvalidChartDefinition
IOException
PersistenceException
Exception
IAction.execute()
public void setContentLinkingTemplate(String template)
protected Object[][] processChartData(org.pentaho.commons.connection.IPentahoResultSet resultSet, int valueColumnIndex)
public void setOutputStream(OutputStream outputStream)
setOutputStream
in interface IStreamingAction
public void setChartContentStream(OutputStream outStream)
outStream
- Stream to receive the chartpublic void setChartData(org.pentaho.commons.connection.IPentahoResultSet chartDataSet)
chartDataSet
- data set for chartingpublic void validate() throws Exception
Exception
public void setSeriesColumn(String seriesCol)
seriesCol
- name of column that contains the Series/Domain for the chartpublic void setConvertNullsToZero(boolean convert)
public boolean getConvertNullsToZero()
public void setCategoryColumn(String categoryCol)
seriesCol
- name of column that contains the Category for the chartpublic void setValueColumn(String valueCol)
seriesCol
- name of column that contains the Value/Range for the chartprotected org.pentaho.chart.plugin.api.IOutput.OutputTypes getOutputType()
public String getMimeType(String streamPropertyName)
getMimeType
in interface IStreamingAction
protected void loadChartEngine()
protected void loadChartModel()
public void setChartModelJson(String chartModelJson)
chartModelJson
- JSON serialized representation of the ChartModelpublic void setChartModelXmlStream(InputStream chartModelStream) throws IOException
chartModelStream
- XML serialized representation of the ChartModelIOException
- if there is a problem converting the input stream to an encoded stringpublic void setChartModelXml(String chartModelXml)
chartStyleXml
- XML serialized representation of the ChartModelpublic void setChartModel(org.pentaho.chart.model.ChartModel chartModel)
chartModel
- model of the chart to be generatedpublic void setChartWidth(int chartWidth)
chartWidth
- width of the chartpublic void setChartHeight(int chartHeight)
chartHeight
- height of the chartpublic void setChartWidth(String chartWidth)
chartWidth
- width of the chartpublic void setChartHeight(String chartHeight)
chartHeight
- height of the chartpublic String getChartEngine()
public void setChartEngine(String chartEngine)
chartEngine
- Value of "JFreeChart" or "OpenFlashChart"public void setOutputType(String outputType)
public void setScalingFactor(Double scalingFactor)
public String getSwfPath()
public String getSwfName()
Copyright © 2017 Hitachi Vantara. All rights reserved.