Package weka.gui.beans
Class WekaOffscreenChartRenderer
java.lang.Object
weka.gui.beans.AbstractOffscreenChartRenderer
weka.gui.beans.WekaOffscreenChartRenderer
- All Implemented Interfaces:
OffscreenChartRenderer
Default OffscreenChartRenderer that uses Weka's built-in chart and graph
classes.
- Version:
- $Revision: 8034 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets a short list of additional options (if any), suitable for displaying in a tip text, in HTML formThe name of this off screen rendererrenderHistogram
(int width, int height, List<Instances> series, String attToPlot, List<String> optionalArgs) Render histogram(s) (numeric attribute) or pie chart (nominal attribute).renderXYLineChart
(int width, int height, List<Instances> series, String xAxis, String yAxis, List<String> optionalArgs) Render an XY line chartrenderXYScatterPlot
(int width, int height, List<Instances> series, String xAxis, String yAxis, List<String> optionalArgs) Render an XY scatter plot
-
Constructor Details
-
WekaOffscreenChartRenderer
public WekaOffscreenChartRenderer()
-
-
Method Details
-
rendererName
The name of this off screen renderer- Returns:
- the name of this off screen renderer
-
optionsTipTextHTML
Gets a short list of additional options (if any), suitable for displaying in a tip text, in HTML form- Specified by:
optionsTipTextHTML
in interfaceOffscreenChartRenderer
- Overrides:
optionsTipTextHTML
in classAbstractOffscreenChartRenderer
- Returns:
- additional options description in simple HTML form
-
renderXYLineChart
public BufferedImage renderXYLineChart(int width, int height, List<Instances> series, String xAxis, String yAxis, List<String> optionalArgs) throws Exception Render an XY line chart- Parameters:
width
- the width of the resulting chart in pixelsheight
- the height of the resulting chart in pixelsseries
- a list of Instances - one for each series to be plottedxAxis
- the name of the attribute for the x-axis (all series Instances are expected to have an attribute of the same type with this name)yAxis
- the name of the attribute for the y-axis (all series Instances are expected to have an attribute of the same type with this name)optionalArgs
- optional arguments to the renderer (may be null)- Returns:
- a BufferedImage containing the chart
- Throws:
Exception
- if there is a problem rendering the chart
-
renderXYScatterPlot
public BufferedImage renderXYScatterPlot(int width, int height, List<Instances> series, String xAxis, String yAxis, List<String> optionalArgs) throws Exception Render an XY scatter plot- Parameters:
width
- the width of the resulting chart in pixelsheight
- the height of the resulting chart in pixelsseries
- a list of Instances - one for each series to be plottedxAxis
- the name of the attribute for the x-axis (all series Instances are expected to have an attribute of the same type with this name)yAxis
- the name of the attribute for the y-axis (all series Instances are expected to have an attribute of the same type with this name)optionalArgs
- optional arguments to the renderer (may be null)- Returns:
- a BufferedImage containing the chart
- Throws:
Exception
- if there is a problem rendering the chart
-
renderHistogram
public BufferedImage renderHistogram(int width, int height, List<Instances> series, String attToPlot, List<String> optionalArgs) throws Exception Render histogram(s) (numeric attribute) or pie chart (nominal attribute). Some implementations may not be able to render more than one histogram/pie on the same chart - the implementation can either throw an exception or just process the first series in this case. This Default implementation uses Weka's built in VisualizeAttributePanel to render with and, as such, can only render histograms. It produces histograms for both numeric and nominal attributes.- Parameters:
width
- the width of the resulting chart in pixelsheight
- the height of the resulting chart in pixelsseries
- a list of Instances - one for each series to be plottedattsToPlot
- the attribute to plot corresponding to the Instances in the series listoptionalArgs
- optional arguments to the renderer (may be null)- Returns:
- a BufferedImage containing the chart
- Throws:
Exception
- if there is a problem rendering the chart
-