public class XYPlotData
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
XYPlotData.DataValue
Nested class for one data value.
|
class |
XYPlotData.MinMax
Inner class to hold minimum and maximum values.
|
static class |
XYPlotData.ScaleData
Nested class containing all data relevant for the scaling
|
Modifier and Type | Field and Description |
---|---|
static double |
MAX_DOUBLE_VALUE |
static double |
MIN_DOUBLE_VALUE |
Constructor and Description |
---|
XYPlotData(XYPlot owner,
int maxNum) |
Modifier and Type | Method and Description |
---|---|
int |
addValue(double x,
double y)
Add a value to the data ring buffer.
|
int |
addValue(double x,
java.lang.String label)
Add a switch value with text and value.
|
void |
changeValues(double[] y)
Exchange all values in the current ring buffer.
|
void |
clear()
Clear the data.
|
void |
clearManualScale()
Make sure that this value is always visible on the y axis.
|
IXYGraphLib.RGB |
getColor()
Get the color used for this data.
|
int |
getCursorPos()
Get the position (index) of the cursor within the data set
|
IXYGraphLib.Rect |
getLegendRect()
Get the position and size of the area where the description of the data set
is located within the global legend area.
|
java.lang.String |
getLegendText()
Get the legend text for this data handler.
|
int |
getMaxNumber()
Get the maximum number od points this data handler can store in its ring
buffer.
|
int |
getNumberOfDecimalPlaces()
Get the number of digits behind the decimal point.
|
java.util.List<java.lang.String> |
getSwitchLabels()
Get the switch labels.
|
java.lang.String |
getUnit()
Get the unit string of the data set
|
XYPlotData.DataValue |
getValue(int index)
Get the data point on a given index position.
|
double |
getXMax()
Get the maximal value used on the x-axis.
|
double |
getXMin()
Get the minimal value used on the x-axis.
|
double |
getYMax()
Get the maximal value used on the y-axis.
|
double |
getYMin()
Get the minimal value used on the y-axis.
|
XYPlotData.MinMax |
getYRange() |
XYPlotData.MinMax |
getYRange(int minIndex,
int maxIndex) |
void |
hideCursor()
Hide cursor
|
boolean |
isAutoScale()
True in case y-axis autoscaling is on.
|
int |
length()
Get the actual number of data points in this data handler.
|
void |
print()
Print some information about scale data
|
void |
setAutoScale(boolean autoScale)
Set autoscaling.
|
void |
setColor(IXYGraphLib.RGB color)
Set the color for this data handler.
|
boolean |
setCursorPos(int cursorPos)
Set the position of the cursor (index)
|
void |
setLegendRect(IXYGraphLib.Rect r)
Set the rectangle where the legend of the data set is displayed in the global
legend area of the plot
|
void |
setLegendText(java.lang.String text)
Set the legend text for this data handler.
|
void |
setManualScale(double min,
double max)
Set manual minimum, maximum values for y axis *
|
void |
setManualScaleMin(double value)
Make sure that this minimum value is always visible on the y axis *
|
void |
setOwner(XYPlot owner)
Set the plot to which the data belong to.
|
void |
setPause()
Declare a break after the last added data point.
|
void |
setUnit(java.lang.String text)
Set the unit string for this data handler e.g.
|
public static final double MAX_DOUBLE_VALUE
public static final double MIN_DOUBLE_VALUE
public XYPlotData(XYPlot owner, int maxNum)
public void clear()
public void setOwner(XYPlot owner)
owner
- The plot the data belong topublic int addValue(double x, double y)
x
- X-Valuey
- Y-Valuepublic int addValue(double x, java.lang.String label)
x
- X valuelabel
- Text of the switch state.public java.util.List<java.lang.String> getSwitchLabels()
public void changeValues(double[] y)
y
- Array with new y valuespublic void setPause()
public XYPlotData.DataValue getValue(int index)
index
- Position in data bufferpublic void setLegendText(java.lang.String text)
text
- The legend textpublic java.lang.String getLegendText()
public void setUnit(java.lang.String text)
text
- The unit text.public java.lang.String getUnit()
public int length()
public int getMaxNumber()
public boolean isAutoScale()
public void setAutoScale(boolean autoScale)
autoScale
- True/falsepublic void setManualScale(double min, double max)
min
- Minimum y valuemax
- Maximum y valuepublic void setManualScaleMin(double value)
value
- Any valuepublic void clearManualScale()
public int getNumberOfDecimalPlaces()
public int getCursorPos()
public boolean setCursorPos(int cursorPos)
cursorPos
- New cursor positionpublic void hideCursor()
public IXYGraphLib.Rect getLegendRect()
public void setLegendRect(IXYGraphLib.Rect r)
r
- Rectangle containing the legendpublic double getXMax()
public double getXMin()
public double getYMax()
public double getYMin()
public void print()
public XYPlotData.MinMax getYRange(int minIndex, int maxIndex)
public XYPlotData.MinMax getYRange()
public void setColor(IXYGraphLib.RGB color)
color
- Color for the data in the plot.public IXYGraphLib.RGB getColor()