ISeriesBarSeries, LineSeriespublic abstract class Series extends java.lang.Object implements ISeries
ISeries.SeriesType| Modifier and Type | Field | Description |
|---|---|---|
protected Chart |
chart |
the chart
|
protected ICompress |
compressor |
the compressor
|
protected static ISeries.SeriesType |
DEFAULT_SERIES_TYPE |
the default series type
|
protected java.lang.String |
id |
the series id
|
protected boolean |
isXMonotoneIncreasing |
the state indicating whether x series are monotone increasing
|
protected double |
maxX |
the maximum value of x series
|
protected double |
maxY |
the maximum value of y series
|
protected double |
minX |
the minimum value of x series
|
protected double |
minY |
the minimum value of y series
|
protected SeriesLabel |
seriesLabel |
the series label
|
protected boolean |
stackEnabled |
the state indicating if the series is a stacked type
|
protected double[] |
stackSeries |
the stack series
|
protected ISeries.SeriesType |
type |
the series type
|
protected boolean |
visible |
the visibility of series
|
protected int |
xAxisId |
the x axis id
|
protected ErrorBar |
xErrorBar |
the x error bar
|
protected double[] |
xSeries |
the x series
|
protected int |
yAxisId |
the y axis id
|
protected ErrorBar |
yErrorBar |
the y error bar
|
protected double[] |
ySeries |
the y series
|
| Modifier | Constructor | Description |
|---|---|---|
protected |
Series(Chart chart,
java.lang.String id) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addDisposeListener(IDisposeListener listener) |
Adds the dispose listener.
|
protected void |
dispose() |
Disposes SWT resources.
|
void |
draw(GC gc,
int width,
int height) |
Draws series.
|
protected abstract void |
draw(GC gc,
int width,
int height,
Axis xAxis,
Axis yAxis) |
Draws series.
|
void |
enableStack(boolean enabled) |
Enables the stack series.
|
abstract Range |
getAdjustedRange(Axis axis,
int length) |
Gets the adjusted range to show all series in screen.
|
protected ICompress |
getCompressor() |
Gets the compressor.
|
java.lang.String |
getDescription() |
Gets the series description
|
java.lang.String |
getId() |
Gets the series id.
|
ISeriesLabel |
getLabel() |
Gets the series label.
|
Point |
getPixelCoordinates(int index) |
Gets the pixel coordinates corresponding to the given series index.
|
protected Range |
getRangeWithMargin(int lowerPlotMargin,
int upperPlotMargin,
int length,
Axis axis,
Range range) |
Gets the range with given margin.
|
ISeries.SeriesType |
getType() |
Gets the series type.
|
int |
getXAxisId() |
Gets the X axis id.
|
java.util.Date[] |
getXDateSeries() |
Gets the X date series.
|
IErrorBar |
getXErrorBar() |
Gets the X error bar.
|
Range |
getXRange() |
Gets the X range of series.
|
double[] |
getXSeries() |
Gets the X series.
|
int |
getYAxisId() |
Gets the Y axis id.
|
IErrorBar |
getYErrorBar() |
Gets the Y error bar.
|
Range |
getYRange() |
Gets the Y range of series.
|
double[] |
getYSeries() |
Gets the Y series.
|
boolean |
isDateSeries() |
Gets the state indicating if date series is set.
|
boolean |
isStackEnabled() |
Gets the state indicating if stack is enabled.
|
boolean |
isValidStackSeries() |
Gets the state indicating if the series is valid stack series.
|
boolean |
isVisible() |
Gets the visibility state.
|
boolean |
isVisibleInLegend() |
Gets the visibility state in legend.
|
protected abstract void |
setCompressor() |
Sets the compressor.
|
void |
setDescription(java.lang.String description) |
Sets the series description.
|
protected void |
setStackSeries(double[] stackSeries) |
Sets the stack series
|
void |
setVisible(boolean visible) |
Sets the visibility state.
|
void |
setVisibleInLegend(boolean visible) |
Sets the visibility state in legend.
|
void |
setXAxisId(int id) |
Sets the X axis id.
|
void |
setXDateSeries(java.util.Date[] series) |
Sets the X date series.
|
void |
setXSeries(double[] series) |
Sets the X series.
|
void |
setYAxisId(int id) |
Sets the Y axis id.
|
void |
setYSeries(double[] series) |
Sets the Y series.
|
protected static final ISeries.SeriesType DEFAULT_SERIES_TYPE
protected double[] xSeries
protected double[] ySeries
protected double minX
protected double maxX
protected double minY
protected double maxY
protected java.lang.String id
protected ICompress compressor
protected int xAxisId
protected int yAxisId
protected boolean visible
protected boolean isXMonotoneIncreasing
protected ISeries.SeriesType type
protected SeriesLabel seriesLabel
protected ErrorBar xErrorBar
protected ErrorBar yErrorBar
protected Chart chart
protected boolean stackEnabled
protected double[] stackSeries
protected Series(Chart chart, java.lang.String id)
chart - the chartid - the series idpublic java.lang.String getId()
ISeriespublic void setVisible(boolean visible)
ISeriessetVisible in interface ISeriesvisible - the visibility statepublic boolean isVisible()
ISeriespublic ISeries.SeriesType getType()
ISeriespublic boolean isStackEnabled()
ISeriesisStackEnabled in interface ISeriespublic void enableStack(boolean enabled)
ISeriesenableStack in interface ISeriesenabled - true if enabling stack seriespublic void setXSeries(double[] series)
ISeriessetXSeries in interface ISeriesseries - the X seriespublic double[] getXSeries()
ISeriesgetXSeries in interface ISeriespublic void setYSeries(double[] series)
ISeriessetYSeries in interface ISeriesseries - the Y seriespublic double[] getYSeries()
ISeriesgetYSeries in interface ISeriespublic void setXDateSeries(java.util.Date[] series)
ISeriesX series and X date series are exclusive. X date series will be cleared by setting X series, and vice versa.
setXDateSeries in interface ISeriesseries - the X date seriespublic java.util.Date[] getXDateSeries()
ISeriesgetXDateSeries in interface ISeriespublic boolean isDateSeries()
public boolean isValidStackSeries()
public Range getXRange()
public abstract Range getAdjustedRange(Axis axis, int length)
axis - the axislength - the axis length in pixelspublic Range getYRange()
protected ICompress getCompressor()
protected abstract void setCompressor()
public int getXAxisId()
ISeriesgetXAxisId in interface ISeriespublic void setXAxisId(int id)
ISeriessetXAxisId in interface ISeriesid - the X axis id.public int getYAxisId()
ISeriesgetYAxisId in interface ISeriespublic void setYAxisId(int id)
ISeriessetYAxisId in interface ISeriesid - the Y axis id.public ISeriesLabel getLabel()
ISeriespublic IErrorBar getXErrorBar()
ISeriesgetXErrorBar in interface ISeriespublic IErrorBar getYErrorBar()
ISeriesgetYErrorBar in interface ISeriesprotected void setStackSeries(double[] stackSeries)
stackSeries - The stack seriespublic Point getPixelCoordinates(int index)
ISeriesgetPixelCoordinates in interface ISeriesindex - the series indexprotected Range getRangeWithMargin(int lowerPlotMargin, int upperPlotMargin, int length, Axis axis, Range range)
lowerPlotMargin - the lower margin in pixelsupperPlotMargin - the upper margin in pixelslength - the axis length in pixelsaxis - the axisrange - the rangepublic void setVisibleInLegend(boolean visible)
ISeriessetVisibleInLegend in interface ISeriesvisible - the visibility state in legendpublic boolean isVisibleInLegend()
ISeriesisVisibleInLegend in interface ISeriespublic void setDescription(java.lang.String description)
ISeriesFor example, you may store the description explaining what this series is, and display it on tool tip with mouse hover on the series.
By default, legend displays the description, when it is set.
setDescription in interface ISeriesdescription - the series description, or null to clear itpublic java.lang.String getDescription()
ISeriesgetDescription in interface ISeriesprotected void dispose()
public void addDisposeListener(IDisposeListener listener)
ISeriesaddDisposeListener in interface ISerieslistener - the dispose listenerpublic void draw(GC gc,
int width,
int height)
gc - the graphics contextwidth - the width to draw seriesheight - the height to draw series