Skip to content

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

@davejbur

Description

@davejbur

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions