Package org.swtchart.internal.series
Class BarSeries
java.lang.Object
org.swtchart.internal.series.Series
org.swtchart.internal.series.BarSeries
- All Implemented Interfaces:
IBarSeries
,ISeries
Bar series.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.swtchart.IBarSeries
IBarSeries.BarWidthStyle
Nested classes/interfaces inherited from interface org.swtchart.ISeries
ISeries.SeriesType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
the initial bar width in pixelsstatic final int
the initial bar padding in percentageFields inherited from class org.swtchart.internal.series.Series
chart, compressor, DEFAULT_SERIES_TYPE, id, isXMonotoneIncreasing, maxX, maxY, minX, minY, seriesLabel, stackEnabled, stackSeries, type, visible, xAxisId, xErrorBar, xSeries, yAxisId, yErrorBar, ySeries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Draws series.getAdjustedRange
(Axis axis, int length) Gets the adjusted range to show all series in screen.org.eclipse.swt.graphics.Color
Gets the bar color.int
Gets the bar padding in percentage.int
Gets the bar width in pixels.Gets the bar width style.org.eclipse.swt.graphics.Rectangle[]
Gets the array of bar rectangles.void
setBarColor
(org.eclipse.swt.graphics.Color color) Sets the bar color.void
setBarPadding
(int padding) Sets the bar padding in percentage.void
setBarWidth
(int width) Sets the bar width in pixels.void
Sets the bar width style.protected void
Sets the compressor.protected void
setRiserIndex
(int riserIndex) Sets the index of riser in a category.Methods inherited from class org.swtchart.internal.series.Series
addDisposeListener, dispose, draw, enableStack, getCompressor, getDescription, getId, getLabel, getPixelCoordinates, getRangeWithMargin, getType, getXAxisId, getXDateSeries, getXErrorBar, getXRange, getXSeries, getYAxisId, getYErrorBar, getYRange, getYSeries, isDateSeries, isStackEnabled, isValidStackSeries, isVisible, isVisibleInLegend, setDescription, setStackSeries, setVisible, setVisibleInLegend, setXAxisId, setXDateSeries, setXSeries, setYAxisId, setYSeries
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.swtchart.ISeries
addDisposeListener, enableStack, getDescription, getId, getLabel, getPixelCoordinates, getType, getXAxisId, getXDateSeries, getXErrorBar, getXSeries, getYAxisId, getYErrorBar, getYSeries, isStackEnabled, isVisible, isVisibleInLegend, setDescription, setVisible, setVisibleInLegend, setXAxisId, setXDateSeries, setXSeries, setYAxisId, setYSeries
-
Field Details
-
INITIAL_BAR_WIDTH
public static final int INITIAL_BAR_WIDTHthe initial bar width in pixels- See Also:
-
INITIAL_PADDING
public static final int INITIAL_PADDINGthe initial bar padding in percentage- See Also:
-
-
Constructor Details
-
BarSeries
Constructor.- Parameters:
chart
- the chartid
- the series id
-
-
Method Details
-
getBarWidthStyle
Description copied from interface:IBarSeries
Gets the bar width style.- Specified by:
getBarWidthStyle
in interfaceIBarSeries
- Parameters:
style
- the bar width style- Returns:
- the bar width style
-
setBarWidthStyle
Description copied from interface:IBarSeries
Sets the bar width style. The default is BarWidthStyle.STRETCHED .- Specified by:
setBarWidthStyle
in interfaceIBarSeries
- Parameters:
style
- the bar width style
-
getBarWidth
public int getBarWidth()Description copied from interface:IBarSeries
Gets the bar width in pixels.- Specified by:
getBarWidth
in interfaceIBarSeries
- Returns:
- the bar width in pixels
-
setBarWidth
public void setBarWidth(int width) Description copied from interface:IBarSeries
Sets the bar width in pixels. The specified bar width is active only when the bar width style is set to BarWidthStyle.FIXED.- Specified by:
setBarWidth
in interfaceIBarSeries
- Parameters:
width
- the bar width in pixels
-
getBarPadding
public int getBarPadding()Description copied from interface:IBarSeries
Gets the bar padding in percentage.- Specified by:
getBarPadding
in interfaceIBarSeries
- Returns:
- the bar padding in percentage
-
setBarPadding
public void setBarPadding(int padding) Description copied from interface:IBarSeries
Sets the bar padding in percentage. The specified padding is active only when the bar width style is set to BarWidthStyle.STRETCHED.- Specified by:
setBarPadding
in interfaceIBarSeries
- Parameters:
padding
- the bar padding in percentage
-
getBarColor
public org.eclipse.swt.graphics.Color getBarColor()Description copied from interface:IBarSeries
Gets the bar color.- Specified by:
getBarColor
in interfaceIBarSeries
- Returns:
- the bar color
-
setBarColor
public void setBarColor(org.eclipse.swt.graphics.Color color) Description copied from interface:IBarSeries
Sets the bar color. If null is given, default color will be set.- Specified by:
setBarColor
in interfaceIBarSeries
- Parameters:
color
- the bar color
-
getBounds
public org.eclipse.swt.graphics.Rectangle[] getBounds()Description copied from interface:IBarSeries
Gets the array of bar rectangles. This method is typically used for mouse listener to check whether mouse cursor is on bar.The returned array has the same size as data points. Depending on X axis range, some bars can be out of screen. In this case, the rectangles for invisible bars will be null in the returned array.
- Specified by:
getBounds
in interfaceIBarSeries
- Returns:
- the array of bar rectangles in pixels.
-
setRiserIndex
protected void setRiserIndex(int riserIndex) Sets the index of riser in a category.- Parameters:
riserIndex
- the index of riser in a category
-
setCompressor
protected void setCompressor()Description copied from class:Series
Sets the compressor.- Specified by:
setCompressor
in classSeries
-
getAdjustedRange
Description copied from class:Series
Gets the adjusted range to show all series in screen. This range includes the size of plot like symbol or bar.- Specified by:
getAdjustedRange
in classSeries
- Parameters:
axis
- the axislength
- the axis length in pixels- Returns:
- the adjusted range
-
draw
Description copied from class:Series
Draws series.
-