public class JFXChartUtil extends Object
Constructor and Description |
---|
JFXChartUtil() |
Modifier and Type | Method and Description |
---|---|
static javafx.scene.layout.Region |
setupZooming(javafx.scene.chart.XYChart<?,?> chart)
Sets up zooming via the
setupZooming(XYChart, EventHandler) method by using the
ChartZoomManager 's default filter . |
static javafx.scene.layout.Region |
setupZooming(javafx.scene.chart.XYChart<?,?> chart,
javafx.event.EventHandler<? super javafx.scene.input.MouseEvent> mouseFilter)
Convenience method for simple and default setup of zooming on an
XYChart via a
ChartZoomManager . |
public static javafx.scene.layout.Region setupZooming(javafx.scene.chart.XYChart<?,?> chart)
setupZooming(XYChart, EventHandler)
method by using the
ChartZoomManager
's default filter
.public static javafx.scene.layout.Region setupZooming(javafx.scene.chart.XYChart<?,?> chart, javafx.event.EventHandler<? super javafx.scene.input.MouseEvent> mouseFilter)
XYChart
via a
ChartZoomManager
. Wraps the chart in the components required to implement zooming. The
current implementation wraps the chart in a StackPane, which has the chart and a blue
translucent rectangle as children. Returns the top level of the created components.
If the chart already has a parent, that parent must be a Pane
, and the chart is
replaced with the wrapping region, and the return value could be ignored. If the chart does
not have a parent, the same wrapping node is returned, which will need to be added to some
parent.
The chart's axes must both be a type of ValueAxis.
The wrapping logic does not seem to be perfect, in fact there is a special case to handle
BorderPane
s. If it's not found to be reliable, then create the wrapping components
yourself (such as in the FXML), or setup zooming before adding it to a parent.mouseFilter
- EventHandler that consumes events that should not trigger a zoom actionCopyright © 2013 Jason Winnebeck. All Rights Reserved.