public class ValueMarker extends Object
EnhancedScatterChart chart = new EnhancedScatterChart(xAxis, yAxis, dataset);
double maxX;
double maxY;
// TODO: compute maxX, and maxY
chart.getMarkers().addDomainMarker(new ValueMarker(maxX, String.format("Max: %1$.1f", maxX), Pos.BOTTOM_RIGHT));
chart.getMarkers().addRangeMarker(new ValueMarker(maxY, String.format("Max: %1$.1f", maxY), Pos.TOP_LEFT));
Type | Property and Description |
---|---|
javafx.beans.property.DoubleProperty |
value |
Constructor and Description |
---|
ValueMarker(double value)
Constructs a marker line drawn at the given value.
|
ValueMarker(double value,
String text)
Constructs a marker line and label drawn at the given value.
|
ValueMarker(double value,
String text,
javafx.geometry.Pos textAnchor)
Constructs a marker line and label drawn at the given value .
|
Modifier and Type | Method and Description |
---|---|
String |
getLabel()
Gets the optional label text.
|
javafx.scene.Group |
getNode()
Gets the current node.
|
javafx.geometry.Pos |
getTextAnchor()
Gets the anchor that defines where the text will be placed.
|
double |
getValue()
Gets the marker value.
|
void |
layoutDomainMarker(javafx.scene.chart.ValueAxis xAxis,
javafx.scene.chart.ValueAxis yAxis)
Lays out this marker on the X (domain) axis.
|
void |
layoutRangeMarker(javafx.scene.chart.ValueAxis xAxis,
javafx.scene.chart.ValueAxis yAxis)
Lays out this marker on the Y (range) axis.
|
protected void |
layoutText() |
void |
setLabel(String text)
Sets the optional label text.
|
void |
setTextAnchor(javafx.geometry.Pos textAnchor)
Sets the anchor that defines where the text will be placed.
|
void |
setValue(double value)
Sets the marker value and hence placement on the chart.
|
javafx.beans.property.DoubleProperty |
valueProperty() |
public javafx.beans.property.DoubleProperty valueProperty
getValue()
,
setValue(double)
public ValueMarker(double value)
value
- The value to be highlighted.public ValueMarker(double value, String text)
value
- The value to be highlighted.text
- The text to display on the line.public ValueMarker(double value, String text, javafx.geometry.Pos textAnchor)
value
- The value to be highlighted.text
- The label text to be displayed on the line.textAnchor
- The anchor point defining where the label should be
placed relative to the value. Valid values include: TOP_LEFT, TOP_RIGHT,
TOP_CENTER, CENTER_LEFT, CENTER_RIGHT, CENTER, BOTTOM_LEFT, BOTTOM_RIGHT,
BOTTOM_CENTERpublic double getValue()
public void setValue(double value)
value
- The new value.public javafx.beans.property.DoubleProperty valueProperty()
getValue()
,
setValue(double)
public String getLabel()
public void setLabel(String text)
text
- The new text value.public javafx.scene.Group getNode()
public javafx.geometry.Pos getTextAnchor()
public void setTextAnchor(javafx.geometry.Pos textAnchor)
textAnchor
- The new text placement anchor.public void layoutDomainMarker(javafx.scene.chart.ValueAxis xAxis, javafx.scene.chart.ValueAxis yAxis)
xAxis
- The chart's X axis.yAxis
- The chart's Y axis.public void layoutRangeMarker(javafx.scene.chart.ValueAxis xAxis, javafx.scene.chart.ValueAxis yAxis)
xAxis
- The chart's X axis.yAxis
- The chart's Y axis.protected void layoutText()
Copyright © 2016 Emxsys. All rights reserved.