Public Member Functions | |
BarWidthStyle | getBarWidthStyle (BarWidthStyle style) |
void | setBarWidthStyle (BarWidthStyle style) |
int | getBarWidth () |
Gets the bar width in pixels. | |
void | setBarWidth (int width) |
Sets the bar width in pixels. | |
int | getBarPadding () |
Gets the bar padding in percentage. | |
void | setBarPadding (int padding) |
Sets the bar padding in percentage. | |
Color | getBarColor () |
Gets the bar color. | |
void | setBarColor (Color color) |
Sets the bar color. | |
Rectangle[] | getBounds () |
Gets the array of bar rectangles. | |
Range | getAdjustedRange (Axis axis, int length) |
Gets the adjusted range to show all series in screen. | |
Static Public Attributes | |
static final int | INITIAL_BAR_WIDTH = 20 |
the initial bar width in pixels | |
static final int | INITIAL_PADDING = 20 |
the initial bar padding in percentage | |
Protected Member Functions | |
BarSeries (Chart chart, String id) | |
Constructor. | |
void | setRiserIndex (int riserIndex) |
Sets the index of riser in a category. | |
void | setCompressor () |
Sets the compressor. | |
void | draw (GC gc, int width, int height, Axis xAxis, Axis yAxis) |
Draws series. | |
Private Member Functions | |
Rectangle[] | getBoundsForCompressedSeries () |
Gets the array of bar rectangles for compressed series. | |
Rectangle | getVisibleRectangle (int x, int y, int width, int height) |
Gets the rectangle that is visible part of given rectangle. | |
int | getRiserWidth (double[] series, int index, Axis xAxis, double min, double max) |
Gets the riser width. | |
void | drawRiser (GC gc, int h, int v, int width, int height) |
Draws riser. | |
Static Private Member Functions | |
static Color | getFrameColor (Color color) |
Gets the color for riser frame. | |
Private Attributes | |
int | riserIndex |
the riser index in a category | |
Color | barColor |
the riser color | |
int | barWidth |
the bar width | |
int | padding |
the padding | |
BarWidthStyle | barWidthStyle |
the bar width style | |
Static Private Attributes | |
static final int | ALPHA = 0xD0 |
the alpha value | |
static final int | MARGIN_AT_MIN_MAX_PLOT = 6 |
the margin in pixels attached at the minimum/maximum plot | |
static final int | DEFAULT_BAR_COLOR = SWT.COLOR_CYAN |
the default bar color |
Bar series.
Definition at line 26 of file BarSeries.java.
org.swtchart.internal.series.BarSeries.BarSeries | ( | Chart | chart, | |
String | id | |||
) | [protected] |
Constructor.
chart | the chart | |
id | the series id |
Definition at line 66 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barColor, org.swtchart.internal.series.BarSeries.barWidth, org.swtchart.internal.series.BarSeries.barWidthStyle, org.swtchart.internal.series.Series.compressor, org.swtchart.internal.series.BarSeries.DEFAULT_BAR_COLOR, org.swtchart.internal.series.BarSeries.INITIAL_PADDING, org.swtchart.internal.series.BarSeries.padding, and org.swtchart.internal.series.Series.type.
void org.swtchart.internal.series.BarSeries.draw | ( | GC | gc, | |
int | width, | |||
int | height, | |||
Axis | xAxis, | |||
Axis | yAxis | |||
) | [protected, virtual] |
Draws series.
gc | the graphics context | |
width | the width to draw series | |
height | the height to draw series | |
xAxis | the x axis | |
yAxis | the y axis |
Implements org.swtchart.internal.series.Series.
Definition at line 439 of file BarSeries.java.
References org.swtchart.internal.series.Series.compressor, org.swtchart.internal.series.ErrorBar.draw(), org.swtchart.internal.series.SeriesLabel.draw(), org.swtchart.internal.series.BarSeries.drawRiser(), org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries(), org.swtchart.internal.compress.ICompress.getCompressedIndexes(), org.swtchart.internal.compress.ICompress.getCompressedYSeries(), org.swtchart.internal.axis.Axis.getPixelCoordinate(), org.swtchart.internal.axis.Axis.isHorizontalAxis, org.swtchart.internal.series.ErrorBar.isVisible, org.swtchart.internal.series.SeriesLabel.isVisible, org.swtchart.internal.series.Series.seriesLabel, org.swtchart.internal.series.Series.xErrorBar, org.swtchart.internal.series.Series.xSeries, org.swtchart.internal.series.Series.yErrorBar, and org.swtchart.internal.series.Series.ySeries.
void org.swtchart.internal.series.BarSeries.drawRiser | ( | GC | gc, | |
int | h, | |||
int | v, | |||
int | width, | |||
int | height | |||
) | [private] |
Draws riser.
gc | the graphics context | |
h | the horizontal coordinate | |
v | the vertical coordinate | |
width | the riser width | |
height | the riser height |
Definition at line 485 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.ALPHA, org.swtchart.internal.series.BarSeries.getBarColor(), and org.swtchart.internal.series.BarSeries.getFrameColor().
Referenced by org.swtchart.internal.series.BarSeries.draw().
Gets the adjusted range to show all series in screen.
This range includes the size of plot like symbol or bar.
Implements org.swtchart.internal.series.Series.
Definition at line 330 of file BarSeries.java.
References org.swtchart.internal.axis.Axis.getDirection(), org.swtchart.internal.series.Series.getRangeWithMargin(), org.swtchart.internal.series.BarSeries.getRiserWidth(), org.swtchart.internal.series.Series.getXRange(), org.swtchart.internal.series.Series.getYRange(), org.swtchart.internal.axis.Axis.isLogScaleEnabled(), org.swtchart.Range.lower, org.swtchart.internal.series.BarSeries.MARGIN_AT_MIN_MAX_PLOT, org.swtchart.internal.series.Series.maxX, org.swtchart.internal.series.Series.minX, org.swtchart.internal.series.Series.minY, org.swtchart.Range.upper, and org.swtchart.internal.series.Series.xSeries.
Color org.swtchart.internal.series.BarSeries.getBarColor | ( | ) |
Gets the bar color.
Implements org.swtchart.IBarSeries.
Definition at line 129 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barColor, and org.swtchart.internal.series.BarSeries.DEFAULT_BAR_COLOR.
Referenced by org.swtchart.internal.series.BarSeries.drawRiser().
int org.swtchart.internal.series.BarSeries.getBarPadding | ( | ) |
Gets the bar padding in percentage.
Implements org.swtchart.IBarSeries.
Definition at line 112 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.padding.
int org.swtchart.internal.series.BarSeries.getBarWidth | ( | ) |
Gets the bar width in pixels.
Implements org.swtchart.IBarSeries.
Definition at line 95 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barWidth.
BarWidthStyle org.swtchart.internal.series.BarSeries.getBarWidthStyle | ( | BarWidthStyle | style | ) |
Definition at line 81 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barWidthStyle.
Rectangle [] org.swtchart.internal.series.BarSeries.getBounds | ( | ) |
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.
- Returns:
- the array of bar rectangles in pixels.
Implements org.swtchart.IBarSeries.
Definition at line 155 of file BarSeries.java.
References org.swtchart.internal.series.Series.chart, org.swtchart.internal.series.Series.compressor, org.swtchart.Chart.getAxisSet(), org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries(), org.swtchart.internal.compress.ICompress.getCompressedXSeries(), org.swtchart.IAxisSet.getXAxis(), org.swtchart.internal.series.Series.xAxisId, and org.swtchart.internal.series.Series.xSeries.
Rectangle [] org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries | ( | ) | [private] |
Gets the array of bar rectangles for compressed series.
Definition at line 180 of file BarSeries.java.
References org.swtchart.internal.series.Series.chart, org.swtchart.internal.series.Series.compressor, org.swtchart.Chart.getAxisSet(), org.swtchart.internal.compress.ICompress.getCompressedIndexes(), org.swtchart.internal.compress.ICompress.getCompressedXSeries(), org.swtchart.internal.compress.ICompress.getCompressedYSeries(), org.swtchart.internal.axis.Axis.getNumRisers(), org.swtchart.internal.axis.Axis.getPixelCoordinate(), org.swtchart.internal.axis.Axis.getRange(), org.swtchart.internal.series.BarSeries.getRiserWidth(), org.swtchart.internal.series.BarSeries.getVisibleRectangle(), org.swtchart.IAxisSet.getXAxis(), org.swtchart.IAxisSet.getYAxis(), org.swtchart.internal.axis.Axis.isHorizontalAxis, org.swtchart.internal.axis.Axis.isLogScaleEnabled(), org.swtchart.internal.axis.Axis.isValidCategoryAxis(), org.swtchart.internal.series.Series.isValidStackSeries(), org.swtchart.Range.lower, org.swtchart.internal.series.BarSeries.riserIndex, org.swtchart.internal.series.Series.stackSeries, org.swtchart.Range.upper, org.swtchart.internal.series.Series.xAxisId, and org.swtchart.internal.series.Series.yAxisId.
Referenced by org.swtchart.internal.series.BarSeries.draw(), and org.swtchart.internal.series.BarSeries.getBounds().
static Color org.swtchart.internal.series.BarSeries.getFrameColor | ( | Color | color | ) | [static, private] |
Gets the color for riser frame.
The color will be darker or lighter than the given color.
color | the riser color |
Definition at line 423 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.drawRiser().
int org.swtchart.internal.series.BarSeries.getRiserWidth | ( | double[] | series, | |
int | index, | |||
Axis | xAxis, | |||
double | min, | |||
double | max | |||
) | [private] |
Gets the riser width.
series | the X series | |
index | the series index | |
xAxis | the X axis | |
min | the min value of range | |
max | the max value of range |
Definition at line 374 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barWidth, org.swtchart.internal.series.BarSeries.barWidthStyle, org.swtchart.internal.axis.Axis.getPixelCoordinate(), and org.swtchart.internal.series.BarSeries.padding.
Referenced by org.swtchart.internal.series.BarSeries.getAdjustedRange(), and org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries().
Rectangle org.swtchart.internal.series.BarSeries.getVisibleRectangle | ( | int | x, | |
int | y, | |||
int | width, | |||
int | height | |||
) | [private] |
Gets the rectangle that is visible part of given rectangle.
x | The x coordinate | |
y | The y coordinate | |
width | the width | |
height | The height |
Definition at line 270 of file BarSeries.java.
References org.swtchart.internal.series.Series.chart, and org.swtchart.Chart.getPlotArea().
Referenced by org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries().
void org.swtchart.internal.series.BarSeries.setBarColor | ( | Color | color | ) |
Sets the bar color.
If null is given, default color will be set.
color | the bar color |
Implements org.swtchart.IBarSeries.
Definition at line 139 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barColor, and org.swtchart.internal.series.BarSeries.DEFAULT_BAR_COLOR.
void org.swtchart.internal.series.BarSeries.setBarPadding | ( | int | padding | ) |
Sets the bar padding in percentage.
The specified padding is active only when the bar width style is set to BarWidthStyle.STRETCHED
.
padding | the bar padding in percentage |
Implements org.swtchart.IBarSeries.
Definition at line 119 of file BarSeries.java.
void org.swtchart.internal.series.BarSeries.setBarWidth | ( | int | width | ) |
Sets the bar width in pixels.
The specified bar width is active only when the bar width style is set to BarWidthStyle.FIXED
.
width | the bar width in pixels |
Implements org.swtchart.IBarSeries.
Definition at line 102 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barWidth, and org.swtchart.internal.series.BarSeries.padding.
void org.swtchart.internal.series.BarSeries.setBarWidthStyle | ( | BarWidthStyle | style | ) |
Definition at line 88 of file BarSeries.java.
References org.swtchart.internal.series.BarSeries.barWidthStyle.
void org.swtchart.internal.series.BarSeries.setCompressor | ( | ) | [protected, virtual] |
Sets the compressor.
Implements org.swtchart.internal.series.Series.
Definition at line 318 of file BarSeries.java.
References org.swtchart.internal.series.Series.compressor, and org.swtchart.internal.series.Series.isXMonotoneIncreasing.
void org.swtchart.internal.series.BarSeries.setRiserIndex | ( | int | riserIndex | ) | [protected] |
Sets the index of riser in a category.
riserIndex | the index of riser in a category |
Definition at line 310 of file BarSeries.java.
final int org.swtchart.internal.series.BarSeries.ALPHA = 0xD0 [static, private] |
the alpha value
Definition at line 50 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.drawRiser().
Color org.swtchart.internal.series.BarSeries.barColor [private] |
the riser color
Definition at line 32 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.BarSeries(), org.swtchart.internal.series.BarSeries.getBarColor(), and org.swtchart.internal.series.BarSeries.setBarColor().
int org.swtchart.internal.series.BarSeries.barWidth [private] |
the bar width
Definition at line 35 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.BarSeries(), org.swtchart.internal.series.BarSeries.getBarWidth(), org.swtchart.internal.series.BarSeries.getRiserWidth(), and org.swtchart.internal.series.BarSeries.setBarWidth().
the bar width style
Definition at line 41 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.BarSeries(), org.swtchart.internal.series.BarSeries.getBarWidthStyle(), org.swtchart.internal.series.BarSeries.getRiserWidth(), and org.swtchart.internal.series.BarSeries.setBarWidthStyle().
final int org.swtchart.internal.series.BarSeries.DEFAULT_BAR_COLOR = SWT.COLOR_CYAN [static, private] |
the default bar color
Definition at line 56 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.BarSeries(), org.swtchart.internal.series.BarSeries.getBarColor(), and org.swtchart.internal.series.BarSeries.setBarColor().
final int org.swtchart.internal.series.BarSeries.INITIAL_BAR_WIDTH = 20 [static] |
the initial bar width in pixels
Definition at line 44 of file BarSeries.java.
final int org.swtchart.internal.series.BarSeries.INITIAL_PADDING = 20 [static] |
the initial bar padding in percentage
Definition at line 47 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.BarSeries().
final int org.swtchart.internal.series.BarSeries.MARGIN_AT_MIN_MAX_PLOT = 6 [static, private] |
the margin in pixels attached at the minimum/maximum plot
Definition at line 53 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.getAdjustedRange().
int org.swtchart.internal.series.BarSeries.padding [private] |
the padding
Definition at line 38 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.BarSeries(), org.swtchart.internal.series.BarSeries.getBarPadding(), org.swtchart.internal.series.BarSeries.getRiserWidth(), and org.swtchart.internal.series.BarSeries.setBarWidth().
int org.swtchart.internal.series.BarSeries.riserIndex [private] |
the riser index in a category
Definition at line 29 of file BarSeries.java.
Referenced by org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries().