-
Notifications
You must be signed in to change notification settings - Fork 20
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
ChartCanvas Positioning #3
Comments
Thanks for the report. I believe the correct fix is to set the x and y to 0, right? I've committed this change. |
SNAPSHOTs aren't being uploaded anywhere yet, but I just uploaded version 1.0.1 so you can use that. |
@jfree Looks like the fix did the trick, thank you for pushing 1.0.1! |
@jfree I am actually having the same issue with the latest build. I am trying to have it display in a GridPane and it will not display unless it is the actual scene. I have 3 cases, 2 of them don't work and one does work but the example that works can't be put inside another hbox or vbox or else it stops working.
|
@ebaisch hi did you resolve this Problem ? because i want to draw a chart i use JFreeChart-FX 1.0.1 |
The layout X and Y of the ChartCanvas are set to the X and Y values of the ChartViewer in its layoutChildren method. The works well only if the ChartViewer is placed at the point of origin (x=0 and y=0) in its surrounding container. Otherwise the ChartCanvas will be placed outside of the ChartViewer.
The layout x and y position the node inside its parent. Therefore the ChartCanvas is placed inside the Chartviewer exactly as the ChartViewer is placed in its parent node which means that the Canvas will be plaxed at X2 and Y2 in the parent node.
See javadoc of Node:
Example for reproduction:
Placing multiple Charts in a VBox (or HBox) will illustrate the problem pretty well, for the coordinates add up for each chart and the gaps are getting bigger.
The text was updated successfully, but these errors were encountered: