X
- type of X valuesY
- type of Y valuespublic class ChartOverlay<X,Y> extends XYChartPlugin<X,Y>
chart pane
or chart's plot area
with given node i.e. the bounds of the node are set to cover the indicated area.
Typically the node would be a an instance of Pane
containing child nodes. The example below shows how to add
a Label to the chart pane, located in the left top corner of the plot area:
XYChartPane<Number, Number> chartPane = ...;
Label label = new Label("Info about chart data");
AnchorPane.setTopAnchor(label, 5.0);
AnchorPane.setLeftAnchor(label, 5.0);
AnchorPane anchorPane = new AnchorPane(label);
// Pass any mouse events to the underlying chart
anchorPane.setMouseTransparent(true);
chartPane.getPlugins().add(new ChartOverlay<>(OverlayArea.PLOT_AREA, anchorPane));
Type | Property and Description |
---|---|
ObjectProperty<Node> |
node
The node to be overlaid on top of the
overlay area . |
ObjectProperty<ChartOverlay.OverlayArea> |
overlayArea
Specifies the
ChartOverlay.OverlayArea to be covered by the node . |
chartPaneProperty
Modifier and Type | Class and Description |
---|---|
static class |
ChartOverlay.OverlayArea
Defines possible areas to be overlaid.
|
Constructor and Description |
---|
ChartOverlay(ChartOverlay.OverlayArea area)
Creates a new, empty
ChartOverlay , initialized to overlay the specified area. |
ChartOverlay(ChartOverlay.OverlayArea area,
Node node)
Creates a new
ChartOverlay , initialized to overlay the specified area with given node. |
Modifier and Type | Method and Description |
---|---|
Node |
getNode()
Returns the value of the
nodeProperty() . |
ChartOverlay.OverlayArea |
getOverlayArea()
Returns the value of the
overlayAreaProperty() . |
void |
layoutChildren()
Optional method that allows the plug-in to react in case the size of the
XYChartPane that it belongs to
has changed. |
ObjectProperty<Node> |
nodeProperty()
The node to be overlaid on top of the
overlay area . |
ObjectProperty<ChartOverlay.OverlayArea> |
overlayAreaProperty()
Specifies the
ChartOverlay.OverlayArea to be covered by the node . |
void |
setNode(Node newNode)
Sets the value of the
nodeProperty() . |
void |
setOverlayArea(ChartOverlay.OverlayArea area)
Sets the value of the
overlayAreaProperty() . |
chartPaneProperty, getChartChildren, getChartPane, getCharts, getLocationInPlotArea, registerMouseEventHandler, setChartPane, toDataPoint, toDisplayPoint
public final ObjectProperty<Node> nodeProperty
overlay area
.getNode()
,
setNode(Node)
public final ObjectProperty<ChartOverlay.OverlayArea> overlayAreaProperty
ChartOverlay.OverlayArea
to be covered by the node
.getOverlayArea()
,
setOverlayArea(OverlayArea)
public ChartOverlay(ChartOverlay.OverlayArea area)
ChartOverlay
, initialized to overlay the specified area.area
- value of overlayAreaProperty()
public ChartOverlay(ChartOverlay.OverlayArea area, Node node)
ChartOverlay
, initialized to overlay the specified area with given node.area
- value of overlayAreaProperty()
node
- value of the nodeProperty()
public final ObjectProperty<Node> nodeProperty()
overlay area
.getNode()
,
setNode(Node)
public final Node getNode()
nodeProperty()
.public final void setNode(Node newNode)
nodeProperty()
.newNode
- the node to overlaidpublic final ObjectProperty<ChartOverlay.OverlayArea> overlayAreaProperty()
ChartOverlay.OverlayArea
to be covered by the node
.getOverlayArea()
,
setOverlayArea(OverlayArea)
public final ChartOverlay.OverlayArea getOverlayArea()
overlayAreaProperty()
.public final void setOverlayArea(ChartOverlay.OverlayArea area)
overlayAreaProperty()
.area
- the area to be coveredpublic void layoutChildren()
XYChartPlugin
XYChartPane
that it belongs to
has changed.layoutChildren
in class XYChartPlugin<X,Y>
Copyright © 2019 CERN. All rights reserved.