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.BarWidthStyleNested classes/interfaces inherited from interface org.swtchart.ISeries
ISeries.SeriesType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intthe initial bar width in pixelsstatic final intthe 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 voidDraws series.getAdjustedRange(Axis axis, int length) Gets the adjusted range to show all series in screen.ColorGets the bar color.intGets the bar padding in percentage.intGets the bar width in pixels.Gets the bar width style.Rectangle[]Gets the array of bar rectangles.voidsetBarColor(Color color) Sets the bar color.voidsetBarPadding(int padding) Sets the bar padding in percentage.voidsetBarWidth(int width) Sets the bar width in pixels.voidSets the bar width style.protected voidSets the compressor.protected voidsetRiserIndex(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, setYSeriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:IBarSeriesGets the bar width style.- Specified by:
getBarWidthStylein interfaceIBarSeries- Parameters:
style- the bar width style- Returns:
- the bar width style
-
setBarWidthStyle
Description copied from interface:IBarSeriesSets the bar width style. The default is BarWidthStyle.STRETCHED .- Specified by:
setBarWidthStylein interfaceIBarSeries- Parameters:
style- the bar width style
-
getBarWidth
public int getBarWidth()Description copied from interface:IBarSeriesGets the bar width in pixels.- Specified by:
getBarWidthin interfaceIBarSeries- Returns:
- the bar width in pixels
-
setBarWidth
public void setBarWidth(int width) Description copied from interface:IBarSeriesSets the bar width in pixels. The specified bar width is active only when the bar width style is set to BarWidthStyle.FIXED.- Specified by:
setBarWidthin interfaceIBarSeries- Parameters:
width- the bar width in pixels
-
getBarPadding
public int getBarPadding()Description copied from interface:IBarSeriesGets the bar padding in percentage.- Specified by:
getBarPaddingin interfaceIBarSeries- Returns:
- the bar padding in percentage
-
setBarPadding
public void setBarPadding(int padding) Description copied from interface:IBarSeriesSets the bar padding in percentage. The specified padding is active only when the bar width style is set to BarWidthStyle.STRETCHED.- Specified by:
setBarPaddingin interfaceIBarSeries- Parameters:
padding- the bar padding in percentage
-
getBarColor
public Color getBarColor()Description copied from interface:IBarSeriesGets the bar color.- Specified by:
getBarColorin interfaceIBarSeries- Returns:
- the bar color
-
setBarColor
public void setBarColor(Color color) Description copied from interface:IBarSeriesSets the bar color. If null is given, default color will be set.- Specified by:
setBarColorin interfaceIBarSeries- Parameters:
color- the bar color
-
getBounds
public Rectangle[] getBounds()Description copied from interface:IBarSeriesGets 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:
getBoundsin 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:SeriesSets the compressor.- Specified by:
setCompressorin classSeries
-
getAdjustedRange
Description copied from class:SeriesGets the adjusted range to show all series in screen. This range includes the size of plot like symbol or bar.- Specified by:
getAdjustedRangein classSeries- Parameters:
axis- the axislength- the axis length in pixels- Returns:
- the adjusted range
-
draw
Description copied from class:SeriesDraws series.
-