public abstract class AbstractChart extends AbstractTestElement implements ReportChart
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HEIGHT |
static int |
DEFAULT_WIDTH |
protected BufferedImage |
image |
static String |
REPORT_CHART_CAPTION |
static String |
REPORT_CHART_HEIGHT |
static String |
REPORT_CHART_TITLE |
static String |
REPORT_CHART_WIDTH |
static String |
REPORT_CHART_X_AXIS |
static String |
REPORT_CHART_X_LABEL |
static String |
REPORT_CHART_Y_AXIS |
static String |
REPORT_CHART_Y_LABEL |
static String |
X_DATA_DATE_LABEL |
static String |
X_DATA_FILENAME_LABEL |
static String[] |
X_LABELS |
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
AbstractChart() |
Modifier and Type | Method and Description |
---|---|
BufferedImage |
getBufferedImage()
this makes it easy to get the bufferedImage
|
String |
getCaption()
The caption is a description for the chart explaining
what the chart means.
|
String |
getFormattedXAxis() |
int |
getHeight()
if the height is not set, the default is returned
|
String |
getTitle()
The title is a the name for the chart.
|
double |
getValue(SamplingStatCalculator stat)
convienance method for getting the selected value.
|
int |
getWidth()
if no width is set, the default is returned
|
String |
getXAxis() |
String |
getXLabel() |
String |
getYAxis() |
String |
getYLabel() |
abstract JComponent |
renderChart(List<DataSet> data)
Subclasses will need to implement the method by doing the following:
1. get the x and y axis
2. filter the table data
3. pass the data to the chart library
4. return the generated chart
|
void |
setBufferedImage(BufferedImage img)
in case an user wants set the bufferdImage
|
void |
setCaption(String caption)
The caption is a description for the chart explaining
what the chart means.
|
void |
setHeight(String height)
set the height of the graph
|
void |
setTitle(String title)
The title is a the name for the chart.
|
void |
setWidth(String width)
set the width of the graph
|
void |
setXAxis(String field) |
void |
setXLabel(String label)
The X data labels should be either the filename, date or some
other series of values
|
void |
setYAxis(String scale) |
void |
setYLabel(String label) |
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
public static final String REPORT_CHART_X_AXIS
public static final String REPORT_CHART_Y_AXIS
public static final String REPORT_CHART_X_LABEL
public static final String REPORT_CHART_Y_LABEL
public static final String REPORT_CHART_TITLE
public static final String REPORT_CHART_CAPTION
public static final String REPORT_CHART_WIDTH
public static final String REPORT_CHART_HEIGHT
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final String X_DATA_FILENAME_LABEL
public static final String X_DATA_DATE_LABEL
public static final String[] X_LABELS
protected BufferedImage image
public String getXAxis()
public String getFormattedXAxis()
public void setXAxis(String field)
public String getYAxis()
public void setYAxis(String scale)
public String getXLabel()
public void setXLabel(String label)
label
- public String getYLabel()
public void setYLabel(String label)
public String getTitle()
public void setTitle(String title)
title
- public String getCaption()
public void setCaption(String caption)
caption
- public int getWidth()
public void setWidth(String width)
width
- public int getHeight()
public void setHeight(String height)
height
- public abstract JComponent renderChart(List<DataSet> data)
renderChart
in interface ReportChart
data
- list of DataSetpublic BufferedImage getBufferedImage()
public void setBufferedImage(BufferedImage img)
img
- public double getValue(SamplingStatCalculator stat)
stat
- Copyright © 1998-2013 Apache Software Foundation. All Rights Reserved.