com.opensymphony.webwork.dispatcher
Class ChartResult
java.lang.Object
com.opensymphony.webwork.dispatcher.ChartResult
- All Implemented Interfaces:
- Result, Serializable
public class ChartResult - extends Object
- implements Result
A custom Result type for chart data. Built on top of
JFreeChart. When executed
this Result will write the given chart as a PNG to the servlet output stream.
- Author:
- Bernard Choi
- See Also:
- Serialized Form
|
Method Summary |
void |
execute(ActionInvocation invocation)
Executes the result. |
void |
setChart(org.jfree.chart.JFreeChart chart)
Sets the JFreeChart to use. |
void |
setHeight(int height)
Sets the chart height. |
void |
setWidth(int width)
Sets the chart width. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChartResult
public ChartResult()
setChart
public void setChart(org.jfree.chart.JFreeChart chart)
- Sets the JFreeChart to use.
- Parameters:
chart - a JFreeChart object.
setHeight
public void setHeight(int height)
- Sets the chart height.
- Parameters:
height - the height of the chart in pixels.
setWidth
public void setWidth(int width)
- Sets the chart width.
- Parameters:
width - the width of the chart in pixels.
execute
public void execute(ActionInvocation invocation)
throws Exception
- Executes the result. Writes the given chart as a PNG to the servlet output stream.
- Specified by:
execute in interface Result
- Parameters:
invocation - an encapsulation of the action execution state.
- Throws:
Exception - if an error occurs when creating or writing the chart to the servlet output stream.
|