org.swtchart.internal.series.BarSeries Class Reference

Bar series. More...

Inheritance diagram for org.swtchart.internal.series.BarSeries:
Inheritance graph
[legend]
Collaboration diagram for org.swtchart.internal.series.BarSeries:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Bar series.

Definition at line 26 of file BarSeries.java.


Constructor & Destructor Documentation

org.swtchart.internal.series.BarSeries.BarSeries ( Chart  chart,
String  id 
) [protected]

Member Function Documentation

void org.swtchart.internal.series.BarSeries.draw ( GC  gc,
int  width,
int  height,
Axis  xAxis,
Axis  yAxis 
) [protected, virtual]
void org.swtchart.internal.series.BarSeries.drawRiser ( GC  gc,
int  h,
int  v,
int  width,
int  height 
) [private]

Draws riser.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

Range org.swtchart.internal.series.BarSeries.getAdjustedRange ( Axis  axis,
int  length 
) [virtual]
Color org.swtchart.internal.series.BarSeries.getBarColor (  ) 

Gets the bar color.

Returns:
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().

Here is the caller graph for this function:

int org.swtchart.internal.series.BarSeries.getBarPadding (  ) 

Gets the bar padding in percentage.

Returns:
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.

Returns:
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  ) 
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.

Here is the call graph for this function:

Rectangle [] org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries (  )  [private]
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.

Parameters:
color the riser color
Returns:
the riser frame color

Definition at line 423 of file BarSeries.java.

Referenced by org.swtchart.internal.series.BarSeries.drawRiser().

Here is the caller graph for this function:

int org.swtchart.internal.series.BarSeries.getRiserWidth ( double[]  series,
int  index,
Axis  xAxis,
double  min,
double  max 
) [private]

Gets the riser width.

Parameters:
series the X series
index the series index
xAxis the X axis
min the min value of range
max the max value of range
Returns:
the raiser width in pixels

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
x The x coordinate
y The y coordinate
width the width
height The height
Returns:
The visible rectangle

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void org.swtchart.internal.series.BarSeries.setBarColor ( Color  color  ) 

Sets the bar color.

If null is given, default color will be set.

Parameters:
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.

Parameters:
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.

Parameters:
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  ) 
void org.swtchart.internal.series.BarSeries.setCompressor (  )  [protected, virtual]
void org.swtchart.internal.series.BarSeries.setRiserIndex ( int  riserIndex  )  [protected]

Sets the index of riser in a category.

Parameters:
riserIndex the index of riser in a category

Definition at line 310 of file BarSeries.java.


Member Data Documentation

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().

final int org.swtchart.internal.series.BarSeries.DEFAULT_BAR_COLOR = SWT.COLOR_CYAN [static, private]

the initial bar width in pixels

Definition at line 44 of file BarSeries.java.

the initial bar padding in percentage

Definition at line 47 of file BarSeries.java.

Referenced by org.swtchart.internal.series.BarSeries.BarSeries().

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().

the riser index in a category

Definition at line 29 of file BarSeries.java.

Referenced by org.swtchart.internal.series.BarSeries.getBoundsForCompressedSeries().


The documentation for this class was generated from the following file:

Generated on 26 Oct 2015 for SWTChart.org by  doxygen 1.6.1