kerner1000 / javafx-chart-zooming

JavaFX chart zooming. (No, not just chart *scaling*)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`final Node chartBackground = chart.lookup(".chart-plot-background"); for what?

lhuangjs opened this issue · comments

Hi, I need the zoom function so I added your ZoomManager class in my application. And I made some changes to it. But when I added my chart in my pane (chart in StackPane in VBox in GridPane in Scene) and zoom, the chart disappeared. So I want to kown your code how to work. However I have a question that I can not understand.

  1. In line 233 final Node chartBackground = chart.lookup(".chart-plot-background"); Do this for what?

Hi,
please see the Examples.

// DO NOT ADD DATA TO CHART
// bc.getData().addAll(series1, series2, series3);
final StackPane pane = new StackPane();
pane.getChildren().add(bc);
final Scene scene = new Scene(pane, 500, 400);
new ZoomManager(pane, bc, series1, series2, series3);

Do not add the chart data to the chart, but to the zoom manager.

Fixed with cd931bd