Skip to content
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

Canvas alignment with XYChart #51

Open
teddy2021 opened this issue Jul 18, 2021 · 3 comments
Open

Canvas alignment with XYChart #51

teddy2021 opened this issue Jul 18, 2021 · 3 comments

Comments

@teddy2021
Copy link

I ran into an issue when programming a custom chart based on the code in the XYChart and XYPane classes. It seems that if your chart has a left y and a bottom y axis, then if you remove one the graph canvas shifts to overlap the other. So, removing the y means the bottom of the canvas is the bottom of the x axis, and removing the x means the left of the canvas is the left of the y axis. In addition to this, the canvas seems to be squashed into a smaller area focused around the remaining axis.
Here are examples:
With both
image

With X only
image

With Y only
image

@HanSolo
Copy link
Owner

HanSolo commented Jul 18, 2021

So what would be the expected behavior if you have a chart with 2D data but only one axis? Suggestions welcome 😁

@teddy2021
Copy link
Author

teddy2021 commented Jul 18, 2021

I would suggest that the remaining axis should be the border, in case of a left, right, top, or bottom axis. I think what's surprising here is that the remaining axis seems to become a center axis of sorts.

@teddy2021
Copy link
Author

I found that setting the Pane's upper and lower bounds in the chart's initGraphics after calling checkForAxis makes the canvas cover the area nicely, but I'm unsure of what to do with the Axis part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants