Class LineSeries

java.lang.Object
org.swtchart.internal.series.Series
org.swtchart.internal.series.LineSeries
All Implemented Interfaces:
ILineSeries, ISeries

public class LineSeries extends Series implements ILineSeries
Line series.
  • Constructor Details

    • LineSeries

      protected LineSeries(Chart chart, String id)
      Constructor.
      Parameters:
      chart - the chart
      id - the series id
  • Method Details

    • getLineStyle

      public LineStyle getLineStyle()
      Description copied from interface: ILineSeries
      Gets line style.
      Specified by:
      getLineStyle in interface ILineSeries
      Returns:
      line style.
    • setLineStyle

      public void setLineStyle(LineStyle style)
      Description copied from interface: ILineSeries
      Sets line style. If null is given, default line style will be set.
      Specified by:
      setLineStyle in interface ILineSeries
      Parameters:
      style - line style
    • getLineColor

      public org.eclipse.swt.graphics.Color getLineColor()
      Description copied from interface: ILineSeries
      Gets the line color.
      Specified by:
      getLineColor in interface ILineSeries
      Returns:
      the line color
    • setLineColor

      public void setLineColor(org.eclipse.swt.graphics.Color color)
      Description copied from interface: ILineSeries
      Sets line color. If null is given, default color will be set.
      Specified by:
      setLineColor in interface ILineSeries
      Parameters:
      color - the line color
    • getLineWidth

      public int getLineWidth()
      Description copied from interface: ILineSeries
      Gets the line width.
      Specified by:
      getLineWidth in interface ILineSeries
      Returns:
      the line width
    • setLineWidth

      public void setLineWidth(int width)
      Description copied from interface: ILineSeries
      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.
      Specified by:
      setLineWidth in interface ILineSeries
      Parameters:
      width - the line width
    • getSymbolType

      public ILineSeries.PlotSymbolType getSymbolType()
      Description copied from interface: ILineSeries
      Gets the symbol type.
      Specified by:
      getSymbolType in interface ILineSeries
      Returns:
      the symbol type
    • setSymbolType

      public void setSymbolType(ILineSeries.PlotSymbolType type)
      Description copied from interface: ILineSeries
      Sets the symbol type. If null is given, default type PlotSymbolType.CIRCLE will be set.
      Specified by:
      setSymbolType in interface ILineSeries
      Parameters:
      type - the symbol type
    • getSymbolSize

      public int getSymbolSize()
      Description copied from interface: ILineSeries
      Gets the symbol size in pixels.
      Specified by:
      getSymbolSize in interface ILineSeries
      Returns:
      the symbol size
    • setSymbolSize

      public void setSymbolSize(int size)
      Description copied from interface: ILineSeries
      Sets the symbol size in pixels. The default size is 4.
      Specified by:
      setSymbolSize in interface ILineSeries
      Parameters:
      size - the symbol size
    • getSymbolColor

      public org.eclipse.swt.graphics.Color getSymbolColor()
      Description copied from interface: ILineSeries
      Gets the symbol color.
      Specified by:
      getSymbolColor in interface ILineSeries
      Returns:
      the symbol color
    • setSymbolColor

      public void setSymbolColor(org.eclipse.swt.graphics.Color color)
      Description copied from interface: ILineSeries
      Sets the symbol color. If null is given, default color will be set.
      Specified by:
      setSymbolColor in interface ILineSeries
      Parameters:
      color - the symbol color
    • getSymbolColors

      public org.eclipse.swt.graphics.Color[] getSymbolColors()
      Description copied from interface: ILineSeries
      Gets the symbol colors.
      Specified by:
      getSymbolColors in interface ILineSeries
      Returns:
      the symbol colors, or empty array if no symbol colors are set.
    • setSymbolColors

      public void setSymbolColors(org.eclipse.swt.graphics.Color[] colors)
      Description copied from interface: ILineSeries
      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).
      Specified by:
      setSymbolColors in interface ILineSeries
      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.
    • setCompressor

      protected void setCompressor()
      Description copied from class: Series
      Sets the compressor.
      Specified by:
      setCompressor in class Series
    • enableArea

      public void enableArea(boolean enabled)
      Description copied from interface: ILineSeries
      Enables the area chart.
      Specified by:
      enableArea in interface ILineSeries
      Parameters:
      enabled - true if enabling area chart
    • isAreaEnabled

      public boolean isAreaEnabled()
      Description copied from interface: ILineSeries
      Gets the state indicating if area chart is enabled.
      Specified by:
      isAreaEnabled in interface ILineSeries
      Returns:
      true if area chart is enabled
    • enableStep

      public void enableStep(boolean enabled)
      Description copied from interface: ILineSeries
      Enables the step chart.
      Specified by:
      enableStep in interface ILineSeries
      Parameters:
      enabled - true if enabling step chart
    • isStepEnabled

      public boolean isStepEnabled()
      Description copied from interface: ILineSeries
      Gets the state indicating if step chart is enabled.
      Specified by:
      isStepEnabled in interface ILineSeries
      Returns:
      true if step chart is enabled
    • getAdjustedRange

      public Range getAdjustedRange(Axis axis, int length)
      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 class Series
      Parameters:
      axis - the axis
      length - the axis length in pixels
      Returns:
      the adjusted range
    • getAntialias

      public int getAntialias()
      Description copied from interface: ILineSeries
      Gets the anti-aliasing value for drawing line. The default value is SWT.DEFAULT.
      Specified by:
      getAntialias in interface ILineSeries
      Returns:
      the anti-aliasing value which can be SWT.DEFAULT, SWT.ON or SWT.OFF.
    • setAntialias

      public void setAntialias(int antialias)
      Description copied from interface: ILineSeries
      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.

      Specified by:
      setAntialias in interface ILineSeries
      Parameters:
      antialias - the anti-aliasing value which can be SWT.DEFAULT, SWT.ON or SWT.OFF.
    • draw

      protected void draw(org.eclipse.swt.graphics.GC gc, int width, int height, Axis xAxis, Axis yAxis)
      Description copied from class: Series
      Draws series.
      Specified by:
      draw in class Series
      Parameters:
      gc - the graphics context
      width - the width to draw series
      height - the height to draw series
      xAxis - the x axis
      yAxis - the y axis
    • drawSeriesSymbol

      public void drawSeriesSymbol(org.eclipse.swt.graphics.GC gc, int h, int v, org.eclipse.swt.graphics.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