public abstract class Series extends Object implements ISeries
ISeries.SeriesType
Modifier and Type | Field and Description |
---|---|
protected Chart |
chart
the chart
|
protected ICompress |
compressor
the compressor
|
protected static ISeries.SeriesType |
DEFAULT_SERIES_TYPE
the default series type
|
protected 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 and Description |
---|---|
protected |
Series(Chart chart,
String id)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDisposeListener(IDisposeListener listener)
Adds the dispose listener.
|
protected void |
dispose()
Disposes SWT resources.
|
void |
draw(org.eclipse.swt.graphics.GC gc,
int width,
int height)
Draws series.
|
protected abstract void |
draw(org.eclipse.swt.graphics.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.
|
String |
getDescription()
Gets the series description
|
String |
getId()
Gets the series id.
|
ISeriesLabel |
getLabel()
Gets the series label.
|
org.eclipse.swt.graphics.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.
|
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(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(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 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
public void setVisible(boolean visible)
ISeries
setVisible
in interface ISeries
visible
- the visibility statepublic boolean isVisible()
ISeries
public ISeries.SeriesType getType()
ISeries
public boolean isStackEnabled()
ISeries
isStackEnabled
in interface ISeries
public void enableStack(boolean enabled)
ISeries
enableStack
in interface ISeries
enabled
- true if enabling stack seriespublic void setXSeries(double[] series)
ISeries
setXSeries
in interface ISeries
series
- the X seriespublic double[] getXSeries()
ISeries
getXSeries
in interface ISeries
public void setYSeries(double[] series)
ISeries
setYSeries
in interface ISeries
series
- the Y seriespublic double[] getYSeries()
ISeries
getYSeries
in interface ISeries
public void setXDateSeries(Date[] series)
ISeries
X series and X date series are exclusive. X date series will be cleared by setting X series, and vice versa.
setXDateSeries
in interface ISeries
series
- the X date seriespublic Date[] getXDateSeries()
ISeries
getXDateSeries
in interface ISeries
public 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()
ISeries
getXAxisId
in interface ISeries
public void setXAxisId(int id)
ISeries
setXAxisId
in interface ISeries
id
- the X axis id.public int getYAxisId()
ISeries
getYAxisId
in interface ISeries
public void setYAxisId(int id)
ISeries
setYAxisId
in interface ISeries
id
- the Y axis id.public ISeriesLabel getLabel()
ISeries
public IErrorBar getXErrorBar()
ISeries
getXErrorBar
in interface ISeries
public IErrorBar getYErrorBar()
ISeries
getYErrorBar
in interface ISeries
protected void setStackSeries(double[] stackSeries)
stackSeries
- The stack seriespublic org.eclipse.swt.graphics.Point getPixelCoordinates(int index)
ISeries
getPixelCoordinates
in interface ISeries
index
- 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)
ISeries
setVisibleInLegend
in interface ISeries
visible
- the visibility state in legendpublic boolean isVisibleInLegend()
ISeries
isVisibleInLegend
in interface ISeries
public void setDescription(String description)
ISeries
For 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 ISeries
description
- the series description, or null to clear itpublic String getDescription()
ISeries
getDescription
in interface ISeries
protected void dispose()
public void addDisposeListener(IDisposeListener listener)
ISeries
addDisposeListener
in interface ISeries
listener
- the dispose listenerpublic void draw(org.eclipse.swt.graphics.GC gc, int width, int height)
gc
- the graphics contextwidth
- the width to draw seriesheight
- the height to draw seriesCopyright © 2017. All rights reserved.