Skip to content

Add crosshair label padding and adjusted crosshair label position when LabelAnchor is center #414

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

Merged
merged 2 commits into from
May 20, 2025

Conversation

DJ-Raven
Copy link
Contributor

@DJ-Raven DJ-Raven commented Aug 4, 2024

This PR I has add new crosshair label padding that draw over the CrosshairOverlay. and adjusted crosshair label position to be within chart dataArea when LabelAnchor is CENTER. this changed apply for both domainCrosshair and rangeCrosshair

Before and no adjusted label position

before

After update and apply padding

crosshair.setLabelPadding(new RectangleInsets(3, 5, 3, 5));

after

Please check this PR I hope this option have in this JFreeChart. or something wrong with this changed please help improve the code changed. Thank you.

@jfree
Copy link
Owner

jfree commented May 20, 2025

Looks good, thanks!

@jfree jfree merged commit 95e08b2 into jfree:master May 20, 2025
@@ -609,6 +640,9 @@ public boolean equals(Object obj) {
if (this.labelYOffset != that.labelYOffset) {
return false;
}
if (!this.labelPadding.equals(labelPadding)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be that.labelPadding

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfree Thank for reviewed. so will make new PR for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seen you changed. Thank you

@DJ-Raven DJ-Raven deleted the update-crosshair branch May 20, 2025 09:14
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

Successfully merging this pull request may close these issues.

2 participants