|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.jfree.chart.style.AbstractChartStyle
schmitzm.jfree.chart.style.BasicChartStyle
public class BasicChartStyle
This class provides a basis chart style for line, area an bar charts.
Field Summary | |
---|---|
protected boolean |
stacked
Stores whether the chart is stacked. |
protected boolean |
stepped
Stores whether the chart is stepped. |
Fields inherited from class schmitzm.jfree.chart.style.AbstractChartStyle |
---|
axisStyle, bgPaint, borderVisible, descStyle, id, legend, LOGGER, maxRendererDatasetIdx, orientation, plotStyle, rendererStyle, TIPGEN_CAT, TIPGEN_XY, titleStyle, tooltips, type, URLGEN_CAT, URLGEN_XY, urls |
Fields inherited from interface schmitzm.jfree.chart.style.ChartStyle |
---|
DOMAIN_AXIS, RANGE_AXIS, RANGE_AXIS2, X_AXIS, Y_AXIS, Y_AXIS_LEFT, Y_AXIS_RIGHT, Y_AXIS2 |
Constructor Summary | |
---|---|
BasicChartStyle(String id)
Creates a normal line style with default values. |
|
BasicChartStyle(String id,
ChartType type)
Creates a normal, vertical line, bar or area style. |
|
BasicChartStyle(String id,
ChartType type,
boolean stacked,
boolean stepped,
PlotOrientation orientation)
Creates a line, area or bar chart style. |
|
BasicChartStyle(String id,
ChartType type,
boolean stacked,
boolean stepped,
PlotOrientation orientation,
String title,
String xTitle,
String yTitle,
boolean legend,
boolean tooltips,
boolean urls)
Creates a chart style. |
Method Summary | |
---|---|
void |
applyToChart(JFreeChart chart)
Applies the style to an existing chart. |
JFreeChart |
applyToDataset(Dataset dataset)
Creates a chart for the given Dataset and applies the style. |
boolean |
isStacked()
Returns whether the chart is stacked. |
boolean |
isStepped()
Returns whether the chart is stepped. |
void |
setStacked(boolean stacked)
Sets whether the chart is stacked. |
void |
setStepped(boolean stepped)
Sets whether the chart is stepped. |
void |
setType(ChartType type)
Sets the type of the chart style. |
protected void |
throwUnsupportedTypeException()
Throws an UnsupportedOperationException . |
Methods inherited from class schmitzm.jfree.chart.style.AbstractChartStyle |
---|
getAxisCount, getAxisStyle, getBackground, getDescStyle, getID, getOrientation, getPlotStyle, getRendererCount, getRendererStyle, getTitleStyle, getType, hasLegend, hasTooltips, hasURLs, isBorderVisible, setAxisStyle, setBackground, setBorderVisible, setDescStyle, setLegend, setOrientation, setPlotStyle, setRendererStyle, setTitleStyle, setTooltips, setURLs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean stacked
protected boolean stepped
Constructor Detail |
---|
public BasicChartStyle(String id)
id
- a (unique) ID for the stylepublic BasicChartStyle(String id, ChartType type)
id
- a (unique) ID for the styletype
- type of the chart layoutpublic BasicChartStyle(String id, ChartType type, boolean stacked, boolean stepped, PlotOrientation orientation)
id
- a (unique) ID for the styletype
- style typestacked
- flag whether the chart is stacked (ignored for line charts)stepped
- flag whether the chart is stepped (ignored for bar charts)orientation
- orientation of the chart (PlotOrientation.VERTICAL
or PlotOrientation.HORIZONTAL
)public BasicChartStyle(String id, ChartType type, boolean stacked, boolean stepped, PlotOrientation orientation, String title, String xTitle, String yTitle, boolean legend, boolean tooltips, boolean urls)
id
- a (unique) ID for the styletype
- style typestacked
- flag whether the chart is stacked (ignored for line charts)stepped
- flag whether the chart is stepped (ignored for bar charts)orientation
- orientation of the chart (PlotOrientation.VERTICAL
or PlotOrientation.HORIZONTAL
)title
- title for the chartxTitle
- title for the chart's X-axisyTitle
- title for the chart's Y-axislegend
- flag whether a legend is generatedtooltips
- flag whether toolstips are generatedurls
- flag whether URLs are generatedMethod Detail |
---|
protected void throwUnsupportedTypeException()
UnsupportedOperationException
.
public void setType(ChartType type)
setType
in class AbstractChartStyle
type
- the chart type
IllegalArgumentException
- if aType
is not of
ChartType.LINE
, ChartType.AREA
or
ChartType.BAR
ChartStyle#ChartType
public boolean isStacked()
false
for line chartspublic void setStacked(boolean stacked)
stacked
property
to false
for line charts, even aStacked
is true
.
public boolean isStepped()
true
for bar chartspublic void setStepped(boolean stepped)
stepped
property
to true
for bar charts, even stepped
is false
.
public JFreeChart applyToDataset(Dataset dataset)
Dataset
and applies the style.
dataset
- the data for the chart
UnsupportedOperationException
- if the style can not be applied
to the given datasetpublic void applyToChart(JFreeChart chart)
applyToChart
in interface ChartStyle
applyToChart
in class AbstractChartStyle
chart
- chart the style is applied to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |