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

Question - how to make text in a tooltip selectable? #438

Open
davejbur opened this issue Mar 20, 2025 · 2 comments
Open

Question - how to make text in a tooltip selectable? #438

davejbur opened this issue Mar 20, 2025 · 2 comments

Comments

@davejbur
Copy link

I am using:

          myBarRenderer.setDefaultToolTipGenerator(new StandardXYToolTipGenerator()
          {
            @Override
            public String generateToolTip(XYDataset dataset, int series, int item)
            {
              return getCaption();
            }
          });

The function getCaption() returns some information about that particular bar using basic HTML.

What I would like to be able to do is make some/all of the information selectable, for copying into another application. Obviously you can do this from a standard HTML page, but clicking the mouse on the tootltip does nothing.

Have others had a similar problem to solve? Is there something I'm missing in the barrenderer (or jfreechart itself)? or do I need to write my own mousedown/mouseup event handler for the barrenderer? or is it best to use something in HTML (I haven't tried it yet, but I imagine it might be possible to use an HTML form input box, but ignore any changes to it?

Thanks for any pointers!

@trashgod
Copy link
Contributor

I'm not sure about selecting text, but you can copy data from the corresponding ChartEntity to the clipboard like this.

@davejbur
Copy link
Author

Thanks, I'll look at that!

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