Package com.inet.report.chart.plot
Class BarPlot
- java.lang.Object
-
- com.inet.report.chart.plot.AbstractPlot
-
- com.inet.report.chart.plot.StandardPlot
-
- com.inet.report.chart.plot.BarPlot
-
- All Implemented Interfaces:
ChartPlot
,java.io.Serializable
public class BarPlot extends StandardPlot
A general class for plotting data of groups of values. This plot can use data from any class that implements theBaseDataset
interface.- Since:
- 8.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inet.report.chart.plot.AbstractPlot
AbstractPlot.GradientSetting
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_BAR_MARGIN_PERCENT
The default bar margin percentage.static double
DEFAULT_BAR_WIDTH
The default bar width.static BarStyle
DEFAULT_STYLE
Default chart style with this plot.static int
ITEM_LABEL_ALIGNMENT_AUTO
A auto label alignment, is default.static int
ITEM_LABEL_ALIGNMENT_HORIZONTAL
A horizontal label alignment.static int
ITEM_LABEL_ALIGNMENT_VERTICAL
A vertical label alignment.-
Fields inherited from class com.inet.report.chart.plot.StandardPlot
ITEM_LABEL_POSITION_BASE, ITEM_LABEL_POSITION_CENTER, ITEM_LABEL_POSITION_INSIDE_OF_MAX, ITEM_LABEL_POSITION_OUTSIDE_OF_MAX
-
Fields inherited from class com.inet.report.chart.plot.AbstractPlot
DEFAULT_COLOR_SEQUENCE, DEFAULT_FOREGROUND_ALPHA, DEFAULT_ITEM_LABEL_COLOR, DEFAULT_ITEM_LABEL_FONT, DEFAULT_OUTLINE_COLOR, DEFAULT_OUTLINE_STYLE, DEFAULT_OUTLINE_WIDTH, TOKEN_PLOT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getBarMarginPercent()
Returns the bar margin in percent where 0.10 is 10 percent.double
getBarWidth()
Returns the maximum bar width in percent where 0.10 is 10 percent.int
getItemLabelAlignment()
Returns the label alignment displayed on the items of this plot.ChartStyle
getStyle()
Returns the style of this chart, ie. the general category this plot belongs to.protected java.lang.StringBuilder
getSubProperties(int depth)
Returns the serialized simple properties of subclasses.boolean
isShowTotal()
Returns the flag that controls whether or not the totals will be showed for each bar.void
readProperties(org.w3c.dom.Element element, Chart2 chart)
Reads the chart properties from the DOMParser Element.void
setBarMarginPercent(double barMarginPercent)
Sets the bar margin (space between the bars).void
setBarWidth(double barWidth)
Sets the maximum bar width, which is specified as a percentage of the available space for all bars,void
setCategoryAxis(GroupAxis categoryAxis)
Sets the axis for categories of this plot.void
setDataAxis(ContinuousNumberAxis dataAxis)
Sets the axis for data of this plot.void
setItemLabelAlignment(int itemLabelAlignment)
Sets the item label alignment.void
setShowTotal(boolean showTotal)
Sets the flag that controls whether or not the totals will be showed for each bar.
Note: this property works only for stacked chart with showing absolute values.void
setStyle(BarStyle style)
Sets a chart style of this bar plot.-
Methods inherited from class com.inet.report.chart.plot.StandardPlot
getCategoryAxis, getDataAxis, getDataset, getItemLabelPosition, getReferencedObject, isShowCumulativeValues, refreshAutoTitles, saveSubProperties, setCategoryAxis, setDataAxis, setDataset, setItemLabelPosition, setShowCumulativeValues
-
Methods inherited from class com.inet.report.chart.plot.AbstractPlot
getBackColor, getColorFormula, getColorSequence, getForegroundAlpha, getGradientSetting, getItemLabelColor, getItemLabelFont, getItemLabelFormat, getItemShape, getOutlineColor, getOutlineStyle, getOutlineWidth, isColorBySeries, isDrawOutline, isSameColorsForSameGroups, isShowLabel, isShowValue, saveProperties, setBackColor, setColorBySeries, setColorFormula, setColorSequence, setDrawOutline, setForegroundAlpha, setGradientSetting, setItemLabelColor, setItemLabelFont, setItemLabelFormat, setItemShape, setOutlineColor, setOutlineStyle, setOutlineWidth, setSameColorsForSameGroups, setShowLabel, setShowValue
-
-
-
-
Field Detail
-
DEFAULT_STYLE
public static final BarStyle DEFAULT_STYLE
Default chart style with this plot.
-
ITEM_LABEL_ALIGNMENT_AUTO
public static final int ITEM_LABEL_ALIGNMENT_AUTO
A auto label alignment, is default.- See Also:
- Constant Field Values
-
ITEM_LABEL_ALIGNMENT_VERTICAL
public static final int ITEM_LABEL_ALIGNMENT_VERTICAL
A vertical label alignment.- See Also:
- Constant Field Values
-
ITEM_LABEL_ALIGNMENT_HORIZONTAL
public static final int ITEM_LABEL_ALIGNMENT_HORIZONTAL
A horizontal label alignment.- See Also:
- Constant Field Values
-
DEFAULT_BAR_MARGIN_PERCENT
public static final double DEFAULT_BAR_MARGIN_PERCENT
The default bar margin percentage.- See Also:
- Constant Field Values
-
DEFAULT_BAR_WIDTH
public static final double DEFAULT_BAR_WIDTH
The default bar width.- See Also:
- Constant Field Values
-
-
Method Detail
-
setCategoryAxis
public void setCategoryAxis(GroupAxis categoryAxis)
Sets the axis for categories of this plot. The category axis shows the values of the first group field.- Parameters:
categoryAxis
- the category axis (null
not permitted)- Since:
- 8.0
- See Also:
StandardPlot.getCategoryAxis()
,GroupAxis
-
setDataAxis
public void setDataAxis(ContinuousNumberAxis dataAxis)
Sets the axis for data of this plot. The data axis shows the summarized values of the data fields.- Parameters:
dataAxis
- the data axis (null
not permitted)- Since:
- 8.0
- See Also:
StandardPlot.getDataAxis()
,ContinuousNumberAxis
-
getStyle
public ChartStyle getStyle()
Returns the style of this chart, ie. the general category this plot belongs to.- Specified by:
getStyle
in classStandardPlot
- Returns:
- the style
- See Also:
BarStyle.BAR2D
,LineStyle.LINE_MARKER
,AreaStyle.AREA2D_STACKED
-
setStyle
public void setStyle(BarStyle style)
Sets a chart style of this bar plot.- Parameters:
style
- the bar style (null
not permitted)- Since:
- 8.0
- See Also:
getStyle()
,BarStyle
-
getItemLabelAlignment
public int getItemLabelAlignment()
Returns the label alignment displayed on the items of this plot.- Returns:
- the alignment.
- Since:
- 8.0
- See Also:
setItemLabelAlignment(int)
,ITEM_LABEL_ALIGNMENT_AUTO
,ITEM_LABEL_ALIGNMENT_HORIZONTAL
,ITEM_LABEL_ALIGNMENT_VERTICAL
-
setItemLabelAlignment
public void setItemLabelAlignment(int itemLabelAlignment)
Sets the item label alignment. An item label is a label with name and value on each chart item. Default alignment isITEM_LABEL_ALIGNMENT_AUTO
.- Parameters:
itemLabelAlignment
- the item label alignment- Throws:
java.lang.IllegalArgumentException
- by unknown alignment.- Since:
- 8.0
- See Also:
getItemLabelAlignment()
,ITEM_LABEL_ALIGNMENT_AUTO
,ITEM_LABEL_ALIGNMENT_HORIZONTAL
,ITEM_LABEL_ALIGNMENT_VERTICAL
-
isShowTotal
public boolean isShowTotal()
Returns the flag that controls whether or not the totals will be showed for each bar.- Returns:
- the flag.
- Since:
- 8.0
- See Also:
setShowTotal(boolean)
-
setShowTotal
public void setShowTotal(boolean showTotal)
Sets the flag that controls whether or not the totals will be showed for each bar.
Note: this property works only for stacked chart with showing absolute values.- Parameters:
showTotal
- the flag- Since:
- 8.0
- See Also:
isShowTotal()
,BarStyle.BAR2D_STACKED
,StandardPlot.setShowCumulativeValues(boolean)
-
getBarMarginPercent
public double getBarMarginPercent()
Returns the bar margin in percent where 0.10 is 10 percent.- Returns:
- the margin
- Since:
- 14.1
- See Also:
setBarMarginPercent(double)
-
setBarMarginPercent
public void setBarMarginPercent(double barMarginPercent)
Sets the bar margin (space between the bars). The value is expressed as a percentage of the available plot width.- Parameters:
barMarginPercent
- the margin (where 0.10 is ten percent)- Since:
- 14.1
-
getBarWidth
public double getBarWidth()
Returns the maximum bar width in percent where 0.10 is 10 percent.- Returns:
- the bar width
- Since:
- 11.0
- See Also:
setBarWidth(double)
-
setBarWidth
public void setBarWidth(double barWidth)
Sets the maximum bar width, which is specified as a percentage of the available space for all bars,- Parameters:
barWidth
- the width (where 0.10 is ten percent)- Since:
- 11.0
- See Also:
getBarWidth()
-
getSubProperties
protected java.lang.StringBuilder getSubProperties(int depth)
Returns the serialized simple properties of subclasses.- Overrides:
getSubProperties
in classStandardPlot
- Parameters:
depth
- the depth of XML indent- Returns:
- the properties.
-
readProperties
public void readProperties(org.w3c.dom.Element element, Chart2 chart)
Reads the chart properties from the DOMParser Element.- Specified by:
readProperties
in interfaceChartPlot
- Overrides:
readProperties
in classStandardPlot
- Parameters:
element
- the DOMParser Elementchart
- the chart
-
-