public class IlvThresholdIndicator extends IlvDataIndicator
IlvDataIndicator
subclass that defines threshold lines and ranges.
An IlvThresholdIndicator
instance defines maximum and
minimum values on given data sets as well as provides a graphical representation of these
limit values.
These limit values are actually data set properties and thus
can be used through the styling API to define a dynamic styling on a series
depending on the threshold values (see below for an example).
Depending on the type of the threshold indicator, the properties for the limit values are:
In addition to these features, an IlvThresholdIndicator
supports direct user interactions in order to modify the limit values:
Here is an example of a series styling. The following rules change the color of the series named "dataSet1" depending on whether the datapoint value lies inside the threshold range indicator.
chart { decorations: @|decorations(@#xIndic); } Subobject#xIndic { class:'ilog.views.chart.graphic.IlvThresholdIndicator(axisIndex, range, text, properties)'; axisIndex: -1; range:\"[5;7]\"; text:''; properties:"xThresholdMin,xThresholdMax"; series:'dataSet1'; } point[\"@|@x-@xThresholdMin\">0][\"@|@x-@xThresholdMax\"<0] { color1: #ff0000; }
Constructor and Description |
---|
IlvThresholdIndicator(int axisIndex,
double value,
String text,
String[] property)
Creates a threshold for the specified value with the specified text.
|
IlvThresholdIndicator(int axisIndex,
IlvDataInterval range,
String text,
String[] properties)
Creates a threshold for the specified range with the specified text.
|
IlvThresholdIndicator(int yAxisIdx,
IlvDataWindow dataWindow,
String text,
String[] properties)
Creates a threshold for the specified data window with the specified text.
|
Modifier and Type | Method and Description |
---|---|
protected void |
chartConnected(IlvChart oldChart,
IlvChart newChart)
Called when the indicator is added to or removed from a chart.
|
String[] |
getProperties()
Returns the name of the properties of this threshold indicator.
|
String[] |
getSeries()
Returns the series associated with this threshold indicator.
|
boolean |
isAnnotationVisible()
Returns whether the scale annotations are visible.
|
boolean |
isInteractive()
Returns whether user interactions are enabled for this threshold.
|
void |
setAnnotationVisible(boolean anno)
Sets whether the scale annotations are visible.
|
void |
setDataWindow(double xmin,
double xmax,
double ymin,
double ymax)
Modifies the data window displayed by this indicator.
|
void |
setInteractive(boolean enable)
Sets whether user interactions are enabled for this threshold.
|
void |
setRange(IlvDataInterval range)
Sets the range displayed by this indicator.
|
void |
setSeries(String[] series)
Sets the series associated with this threshold indicator.
|
void |
setValue(double value)
Sets the value displayed by the indicator.
|
afterDraw, baseTextDirectionChanged, beforeDraw, componentOrientationChanged, computeLabelLocation, contains, draw, getAxisIndex, getBounds, getDataWindow, getDrawStyle, getLabelRenderer, getRange, getShape, getStyle, getText, getType, getValue, has3DSupport, setDataWindow, setLabelRenderer, setStyle, setText, setVisible, updateBoundsCache
getChart, getDrawOrder, isVisible, repaint, setDrawOrder
public IlvThresholdIndicator(int axisIndex, double value, String text, String[] property)
axisIndex
- The index of the considered axis:
-1
for the x-axis, or the index of a given
y-axis. The type of this indicator is set to
X_VALUE
or Y_VALUE
accordingly.value
- The considered value.text
- The text to display. May be null
if no text is drawn.property
- The property name of the threshold value. The expected
size is one element.IllegalArgumentException
- if the properties array has not the
expected size.IlvDataIndicator.getType()
public IlvThresholdIndicator(int axisIndex, IlvDataInterval range, String text, String[] properties)
axisIndex
- The index of the considered axis:
-1
for the x-axis, or the index of a given
y-axis. The type of this indicator is set to
X_RANGE
or Y_RANGE
accordingly.range
- The considered range.text
- The text to display. May be null
if no text is drawn.properties
- The property names of the threshold. The expected size
is two elements. The first element in the array is the minimum threshold,
the second element is the maximum threshold.IllegalArgumentException
- if the properties array has not the
expected size.IlvDataIndicator.getType()
public IlvThresholdIndicator(int yAxisIdx, IlvDataWindow dataWindow, String text, String[] properties)
WINDOW
.yAxisIdx
- The index of the considered y-axis.dataWindow
- The considered data window.text
- The text to display. May be null
if no text is drawn.properties
- The property names of the threshold. The expected size
is four elements. The first element in the array is the minimum threshold
along the x-axis, the second element is the maximum threshold along the
x-axis, the third element is the minimum threshold
along the y-axis, the fourth element is the maximum threshold along the
y-axis.IllegalArgumentException
- if the properties array has not the
expected size.IlvDataIndicator.getType()
public final String[] getProperties()
public final boolean isAnnotationVisible()
public void setAnnotationVisible(boolean anno)
true
.isAnnotationVisible()
public final boolean isInteractive()
setInteractive(boolean)
public void setInteractive(boolean enable)
false
.public void setValue(double value)
X_VALUE
or Y_VALUE
.setValue
in class IlvDataIndicator
UnsupportedOperationException
- The type of the indicator is
different from X_VALUE
or Y_VALUE
.public void setRange(IlvDataInterval range)
X_RANGE
or Y_RANGE
.setRange
in class IlvDataIndicator
UnsupportedOperationException
- The type of the indicator is
different from X_RANGE
or Y_RANGE
.public void setDataWindow(double xmin, double xmax, double ymin, double ymax)
WINDOW
.setDataWindow
in class IlvDataIndicator
UnsupportedOperationException
- The type of the indicator is
not WINDOW
.protected void chartConnected(IlvChart oldChart, IlvChart newChart)
chartConnected
in class IlvDataIndicator
oldChart
- The chart with which the decoration was associated, or
null
if the decoration is added to a new chart.newChart
- The chart to which the decoration is added, or
null
if the decoration is removed from its current chart.IndexOutOfBoundsException
- If the index of the y-axis is not valid.IlvChartOwnedDrawable.getChart()
public String[] getSeries()
public void setSeries(String[] series)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.