org.swtchart.internal.series.LineSeries Class Reference

Line series. More...

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

List of all members.

Public Member Functions

LineStyle getLineStyle ()
 Gets line style.
void setLineStyle (LineStyle style)
Color getLineColor ()
 Gets the line color.
void setLineColor (Color color)
 Sets line color.
int getLineWidth ()
 Gets the line width.
void setLineWidth (int width)
 Sets the width of line connecting data points and also line drawing symbol if applicable (i.e.
PlotSymbolType getSymbolType ()
 Gets the symbol type.
void setSymbolType (PlotSymbolType type)
int getSymbolSize ()
 Gets the symbol size in pixels.
void setSymbolSize (int size)
 Sets the symbol size in pixels.
Color getSymbolColor ()
 Gets the symbol color.
void setSymbolColor (Color color)
 Sets the symbol color.
Color[] getSymbolColors ()
 Gets the symbol colors.
void setSymbolColors (Color[] colors)
 Sets the symbol colors.
void enableArea (boolean enabled)
 Enables the area chart.
boolean isAreaEnabled ()
 Gets the state indicating if area chart is enabled.
void enableStep (boolean enabled)
 Enables the step chart.
boolean isStepEnabled ()
 Gets the state indicating if step chart is enabled.
Range getAdjustedRange (Axis axis, int length)
 Gets the adjusted range to show all series in screen.
int getAntialias ()
 Gets the anti-aliasing value for drawing line.
void setAntialias (int antialias)
 Sets the anti-aliasing value for drawing line.
void drawSeriesSymbol (GC gc, int h, int v, Color color)
 Draws series symbol.

Protected Member Functions

 LineSeries (Chart chart, String id)
 Constructor.
void setCompressor ()
 Sets the compressor.
void draw (GC gc, int width, int height, Axis xAxis, Axis yAxis)
 Draws series.

Private Member Functions

int[] getLinePoints (double[] xseries, double[] yseries, int[] indexes, int index, Axis xAxis, Axis yAxis)
 Gets the line points to draw line and area.
void drawLineAndArea (GC gc, int width, int height, Axis xAxis, Axis yAxis)
 Draws the line and area.
void drawArea (GC gc, int[] p, boolean isHorizontal)
 Draws the area.
void drawSymbolAndLabel (GC gc, int width, int height, Axis xAxis, Axis yAxis)
 Draws series symbol, label and error bars.

Static Private Member Functions

static void drawLine (GC gc, Axis xAxis, Axis yAxis, double[] xseries, double[] yseries, boolean isHorizontal)
static void drawLineWithStyle (GC gc, Axis xAxis, Axis yAxis, double[] xseries, double[] yseries, boolean isHorizontal)
 Draws the line segments with line style.
static void addPoint (List< Integer > pointList, int x, int y, boolean isHorizontal)

Private Attributes

int symbolSize
 the symbol size in pixel
Color symbolColor
 the symbol color
Color[] symbolColors
 the symbol colors
PlotSymbolType symbolType
 the symbol type
LineStyle lineStyle
 the line style
Color lineColor
 the line color
int lineWidth
 the line width
boolean areaEnabled
 the state indicating if area chart is enabled
boolean stepEnabled
 the state indicating if step chart is enabled
int antialias
 the anti-aliasing value for drawing line

Static Private Attributes

static final int ALPHA = 50
 the alpha value to draw area
static final LineStyle DEFAULT_LINE_STYLE = LineStyle.SOLID
 the default line style
static final int DEFAULT_LINE_WIDTH = 1
 the default line width
static final int DEFAULT_LINE_COLOR = SWT.COLOR_BLUE
 the default line color
static final int DEFAULT_SYMBOL_COLOR = SWT.COLOR_DARK_GRAY
 the default symbol color
static final int DEFAULT_SIZE = 4
 the default symbol size
static final PlotSymbolType DEFAULT_SYMBOL_TYPE = PlotSymbolType.CIRCLE
 the default symbol type
static final int DEFAULT_ANTIALIAS = SWT.DEFAULT
 the default anti-aliasing value
static final int MARGIN_AT_MIN_MAX_PLOT = 6
 the margin in pixels attached at the minimum/maximum plot

Detailed Description

Line series.

Definition at line 29 of file LineSeries.java.


Constructor & Destructor Documentation

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

Member Function Documentation

static void org.swtchart.internal.series.LineSeries.addPoint ( List< Integer >  pointList,
int  x,
int  y,
boolean  isHorizontal 
) [static, private]

Definition at line 656 of file LineSeries.java.

Referenced by org.swtchart.internal.series.LineSeries.drawLineWithStyle().

Here is the caller graph for this function:

void org.swtchart.internal.series.LineSeries.draw ( GC  gc,
int  width,
int  height,
Axis  xAxis,
Axis  yAxis 
) [protected, virtual]
void org.swtchart.internal.series.LineSeries.drawArea ( GC  gc,
int[]  p,
boolean  isHorizontal 
) [private]

Draws the area.

Parameters:
gc the graphic context
p the line points
isHorizontal true if orientation is horizontal

Definition at line 677 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.ALPHA, org.swtchart.internal.series.LineSeries.getLineColor(), and org.swtchart.internal.series.LineSeries.stepEnabled.

Referenced by org.swtchart.internal.series.LineSeries.drawLineAndArea().

Here is the call graph for this function:

Here is the caller graph for this function:

static void org.swtchart.internal.series.LineSeries.drawLine ( GC  gc,
Axis  xAxis,
Axis  yAxis,
double[]  xseries,
double[]  yseries,
boolean  isHorizontal 
) [static, private]
void org.swtchart.internal.series.LineSeries.drawLineAndArea ( GC  gc,
int  width,
int  height,
Axis  xAxis,
Axis  yAxis 
) [private]
static void org.swtchart.internal.series.LineSeries.drawLineWithStyle ( GC  gc,
Axis  xAxis,
Axis  yAxis,
double[]  xseries,
double[]  yseries,
boolean  isHorizontal 
) [static, private]

Draws the line segments with line style.

When there are multiple data points at the same x pixel coordinate, it is inefficient to simply draw vertical lines connecting them by overlaying. Instead, only a single vertical line representing the overlaid multiple vertical lines is drawn at that x pixel coordinate.

That's why vertical line is handled differently from non-vertical line in this method.

Parameters:
gc the graphic context
xAxis the x axis
yAxis the y axis
xseries the x series
yseries the y series
isHorizontal true if orientation is horizontal

Definition at line 593 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.addPoint(), org.swtchart.internal.axis.Axis.getPixelCoordinate(), org.swtchart.internal.axis.Axis.getRange(), org.swtchart.Range.lower, and org.swtchart.Range.upper.

Referenced by org.swtchart.internal.series.LineSeries.drawLineAndArea().

Here is the call graph for this function:

Here is the caller graph for this function:

void org.swtchart.internal.series.LineSeries.drawSeriesSymbol ( GC  gc,
int  h,
int  v,
Color  color 
)

Draws series symbol.

Parameters:
gc the GC object
h the horizontal coordinate to draw symbol
v the vertical coordinate to draw symbol
color the symbol color

Definition at line 774 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.symbolSize, and org.swtchart.internal.series.LineSeries.symbolType.

Referenced by org.swtchart.internal.series.LineSeries.drawSymbolAndLabel().

Here is the caller graph for this function:

void org.swtchart.internal.series.LineSeries.drawSymbolAndLabel ( GC  gc,
int  width,
int  height,
Axis  xAxis,
Axis  yAxis 
) [private]
void org.swtchart.internal.series.LineSeries.enableArea ( boolean  enabled  ) 

Enables the area chart.

Parameters:
enabled true if enabling area chart

Implements org.swtchart.ILineSeries.

Definition at line 288 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.areaEnabled.

void org.swtchart.internal.series.LineSeries.enableStep ( boolean  enabled  ) 

Enables the step chart.

Parameters:
enabled true if enabling step chart

Implements org.swtchart.ILineSeries.

Definition at line 302 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.stepEnabled.

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

Gets the adjusted range to show all series in screen.

This range includes the size of plot like symbol or bar.

Parameters:
axis the axis
length the axis length in pixels
Returns:
the adjusted range

Implements org.swtchart.internal.series.Series.

Definition at line 317 of file LineSeries.java.

References org.swtchart.internal.axis.Axis.getDirection(), org.swtchart.internal.series.Series.getRangeWithMargin(), org.swtchart.internal.series.LineSeries.getSymbolSize(), org.swtchart.internal.series.Series.getXRange(), org.swtchart.internal.series.Series.getYRange(), and org.swtchart.internal.series.LineSeries.MARGIN_AT_MIN_MAX_PLOT.

Here is the call graph for this function:

int org.swtchart.internal.series.LineSeries.getAntialias (  ) 

Gets the anti-aliasing value for drawing line.

The default value is SWT.DEFAULT<tt>.

Returns:
the anti-aliasing value which can be SWT.DEFAULT, SWT.ON or SWT.OFF.

Implements org.swtchart.ILineSeries.

Definition at line 336 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.antialias.

Color org.swtchart.internal.series.LineSeries.getLineColor (  ) 

Gets the line color.

Returns:
the line color

Implements org.swtchart.ILineSeries.

Definition at line 141 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.DEFAULT_LINE_COLOR, and org.swtchart.internal.series.LineSeries.lineColor.

Referenced by org.swtchart.internal.series.LineSeries.drawArea(), and org.swtchart.internal.series.LineSeries.drawLineAndArea().

Here is the caller graph for this function:

int [] org.swtchart.internal.series.LineSeries.getLinePoints ( double[]  xseries,
double[]  yseries,
int[]  indexes,
int  index,
Axis  xAxis,
Axis  yAxis 
) [private]

Gets the line points to draw line and area.

Parameters:
xseries the horizontal series
yseries the vertical series
indexes the series indexes
index the index of series
xAxis the X axis
yAxis the Y axis
Returns:
the line points

Definition at line 368 of file LineSeries.java.

References org.swtchart.internal.axis.Axis.getPixelCoordinate(), org.swtchart.internal.axis.Axis.getRange(), org.swtchart.internal.axis.Axis.isHorizontalAxis, org.swtchart.internal.axis.Axis.isLogScaleEnabled(), org.swtchart.internal.series.Series.isValidStackSeries(), org.swtchart.Range.lower, and org.swtchart.internal.series.Series.stackSeries.

Referenced by org.swtchart.internal.series.LineSeries.drawLineAndArea().

Here is the call graph for this function:

Here is the caller graph for this function:

LineStyle org.swtchart.internal.series.LineSeries.getLineStyle (  ) 

Gets line style.

Returns:
line style.

Implements org.swtchart.ILineSeries.

Definition at line 118 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.lineStyle.

Referenced by org.swtchart.internal.series.LineSeries.setCompressor().

Here is the caller graph for this function:

int org.swtchart.internal.series.LineSeries.getLineWidth (  ) 

Gets the line width.

Returns:
the line width

Implements org.swtchart.ILineSeries.

Definition at line 167 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.lineWidth.

Color org.swtchart.internal.series.LineSeries.getSymbolColor (  ) 

Gets the symbol color.

Returns:
the symbol color

Implements org.swtchart.ILineSeries.

Definition at line 221 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.symbolColor.

Referenced by org.swtchart.internal.series.LineSeries.drawSymbolAndLabel().

Here is the caller graph for this function:

Color [] org.swtchart.internal.series.LineSeries.getSymbolColors (  ) 

Gets the symbol colors.

Returns:
the symbol colors, or empty array if no symbol colors are set.

Implements org.swtchart.ILineSeries.

Definition at line 244 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.symbolColors.

int org.swtchart.internal.series.LineSeries.getSymbolSize (  ) 

Gets the symbol size in pixels.

Returns:
the symbol size

Implements org.swtchart.ILineSeries.

Definition at line 203 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.symbolSize.

Referenced by org.swtchart.internal.series.LineSeries.getAdjustedRange().

Here is the caller graph for this function:

PlotSymbolType org.swtchart.internal.series.LineSeries.getSymbolType (  ) 

Gets the symbol type.

Returns:
the symbol type

Implements org.swtchart.ILineSeries.

Definition at line 185 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.symbolType.

Referenced by org.swtchart.internal.series.LineSeries.drawSymbolAndLabel().

Here is the caller graph for this function:

boolean org.swtchart.internal.series.LineSeries.isAreaEnabled (  ) 

Gets the state indicating if area chart is enabled.

Returns:
true if area chart is enabled

Implements org.swtchart.ILineSeries.

Definition at line 295 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.areaEnabled.

boolean org.swtchart.internal.series.LineSeries.isStepEnabled (  ) 

Gets the state indicating if step chart is enabled.

Returns:
true if step chart is enabled

Implements org.swtchart.ILineSeries.

Definition at line 309 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.stepEnabled.

void org.swtchart.internal.series.LineSeries.setAntialias ( int  antialias  ) 

Sets the anti-aliasing value for drawing line.

If number of data points is too large, the series is drawn as a collection of dots rather than lines. In this case, the anti-alias doesn't really make effect, and just causes performance degradation. Therefore, client code may automatically enable/disable the anti-alias for each series depending on the number of data points, or alternatively may let end-user configure it.

Parameters:
antialias the anti-aliasing value which can be SWT.DEFAULT, SWT.ON or SWT.OFF.

Implements org.swtchart.ILineSeries.

Definition at line 343 of file LineSeries.java.

void org.swtchart.internal.series.LineSeries.setCompressor (  )  [protected, virtual]
void org.swtchart.internal.series.LineSeries.setLineColor ( Color  color  ) 

Sets line color.

If null is given, default color will be set.

Parameters:
color the line color

Implements org.swtchart.ILineSeries.

Definition at line 151 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.DEFAULT_LINE_COLOR, and org.swtchart.internal.series.LineSeries.lineColor.

void org.swtchart.internal.series.LineSeries.setLineStyle ( LineStyle  style  ) 
void org.swtchart.internal.series.LineSeries.setLineWidth ( int  width  ) 

Sets the width of line connecting data points and also line drawing symbol if applicable (i.e.

PlotSymbolType.CROSS or PlotSymbolType.PLUS). The default width is 1.

Parameters:
width the line width

Implements org.swtchart.ILineSeries.

Definition at line 174 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.DEFAULT_LINE_WIDTH, and org.swtchart.internal.series.LineSeries.lineWidth.

void org.swtchart.internal.series.LineSeries.setSymbolColor ( Color  color  ) 

Sets the symbol color.

If null is given, default color will be set.

Parameters:
color the symbol color

Implements org.swtchart.ILineSeries.

Definition at line 228 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.DEFAULT_SYMBOL_COLOR, and org.swtchart.internal.series.LineSeries.symbolColor.

void org.swtchart.internal.series.LineSeries.setSymbolColors ( Color[]  colors  ) 

Sets the symbol colors.

Typically, the number of symbol colors is the same as the number of plots. If the number of symbol colors is less than the number of plots, the rest of plots will have the common color which is set with setSymbolColor(Color).

Parameters:
colors the symbol colors. If null or empty array is given, the color which is set with setSymbolColor(Color) will be commonly used for all plots.

Implements org.swtchart.ILineSeries.

Definition at line 255 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.symbolColors.

void org.swtchart.internal.series.LineSeries.setSymbolSize ( int  size  ) 

Sets the symbol size in pixels.

The default size is 4.

Parameters:
size the symbol size

Implements org.swtchart.ILineSeries.

Definition at line 210 of file LineSeries.java.

References org.swtchart.internal.series.LineSeries.DEFAULT_SIZE, and org.swtchart.internal.series.LineSeries.symbolSize.

void org.swtchart.internal.series.LineSeries.setSymbolType ( PlotSymbolType  type  ) 

Member Data Documentation

final int org.swtchart.internal.series.LineSeries.ALPHA = 50 [static, private]

the alpha value to draw area

Definition at line 62 of file LineSeries.java.

Referenced by org.swtchart.internal.series.LineSeries.drawArea().

final int org.swtchart.internal.series.LineSeries.DEFAULT_ANTIALIAS = SWT.DEFAULT [static, private]

the default anti-aliasing value

Definition at line 83 of file LineSeries.java.

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

final int org.swtchart.internal.series.LineSeries.DEFAULT_LINE_COLOR = SWT.COLOR_BLUE [static, private]
final LineStyle org.swtchart.internal.series.LineSeries.DEFAULT_LINE_STYLE = LineStyle.SOLID [static, private]

the default symbol size

Definition at line 77 of file LineSeries.java.

Referenced by org.swtchart.internal.series.LineSeries.setSymbolSize().

final int org.swtchart.internal.series.LineSeries.DEFAULT_SYMBOL_COLOR = SWT.COLOR_DARK_GRAY [static, private]
final PlotSymbolType org.swtchart.internal.series.LineSeries.DEFAULT_SYMBOL_TYPE = PlotSymbolType.CIRCLE [static, private]

the margin in pixels attached at the minimum/maximum plot

Definition at line 86 of file LineSeries.java.

Referenced by org.swtchart.internal.series.LineSeries.getAdjustedRange().


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

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