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

Add ability to set desired margins #91

Open
matoos32 opened this issue Oct 3, 2023 · 0 comments
Open

Add ability to set desired margins #91

matoos32 opened this issue Oct 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@matoos32
Copy link
Owner

matoos32 commented Oct 3, 2023

While investigating issue #32 using the demo app, I first added the ability to set the time-axis lower and upper margin values in ChartBuilder. While this worked fine for time-gapped charts that use DateAxis, this quickly became non-trivial for gapless charts that rely on NumberAxis. Part of the issue was the gapless chart NumberAxis not adding tick labels in the margin area of the axis like DateAxis does. The other was if the margin value was set near or above 0.01 (1% of the axis range) in gapless charts, then the logic in NumberAxis#selectHorizontalAutoTickUnit(Graphics2D, Rectangle2D, RectangleEdge) would "guess" a number of ticks that was way too large. The result was too many closely packed tick labels with labels and plotted data overlapping. It seemed to have to do with the TickUnit size being calculated too small (~2.0) as opposed to a value of 5.0. When I hard-coded the gapless chart tick unit to 5.0 it created a nice amount of ticks with margin values above 0.01.

This ticket is to find a way to allow setting top/right/bottom/left margin values with charts rendering OK.

@matoos32 matoos32 added the enhancement New feature or request label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant