-
Notifications
You must be signed in to change notification settings - Fork 20
Charts cannot be seen if pane created in FXML #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm wondering if this is related to bug #3. I fixed that one, but still have to release a new version. |
New version is out. I didn't check if it fixes this bug yet (no time), if anyone else does let me know :) |
@jfree This is still a problem. Nothing appears and no errors populate with the example similar to above:
.... ``
`` and the FXML looks like
`` If I modify the example slightly to
`` This throws the error
|
Also, as a workaround I have used this code ``
`` and this renders. However, various other items do not function including tooltips. |
I think the issue is just that the ChartViewer doesn't have the prefWidth and prefHeight set. You can either do this in the initialize() method in the controller:
...or you could add the ChartViewer to your FXML and then just set the chart in the initialise method (because the default constructor for ChartViewer sets the chart to null).
|
still does not work, any ideas how to get it done? |
The crosshair overlay example was modified to appear in a pane defined in the FXML file.
in the controller declared:
// some code here//
@FXML
AnchorPane pane;
// Blah-blah
some code...//
@OverRide
public void initialize(URL url, ResourceBundle rb) {
freeCharts charts = new freeCharts();
XYDataset dataset = charts.createDataset();
JFreeChart chart = charts.createChart(dataset);
ChartViewer viewer = new ChartViewer(chart);
pane.getChildren().add(viewer);
Does not produce a visible chart.
The text was updated successfully, but these errors were encountered: