Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6203481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:55:30+00:00 2026-05-24T04:55:30+00:00

How can I generate a tooltip on chart mouse over in JFreeChart ? I

  • 0

How can I generate a tooltip on chart mouse over in JFreeChart?
I tried this:

chartPanel.setToolTipText("this is the string");

but this does not work. Am I supposed to do something else before? Something like this:

chartPanel.createToolTip().

I am calling these methods in the chartMouseMoved event.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:55:30+00:00Added an answer on May 24, 2026 at 4:55 am

    Most ChartFactory methods include a boolean tooltips parameter. Just look in the source for your factory of choice to see how to instantiate a default tooltip generator suitable for the designated renderer. You shouldn’t need to handle the events yourself.

    Addendum: As you are using createXYLineChart, an instance of StandardXYToolTipGenerator is supplied by default. The DEFAULT_TOOL_TIP_FORMAT is {0}: ({1}, {2}); the MessageFormat symbols represent the dataset, series and item, respectively. You can use these symbols in your own generator, as shown in this XYItemLabelGenerator, or you can override generateToolTip() to return anything at all.

    Addendum: Here’s an example that shows just the dataset:

    XYPlot plot = chart.getXYPlot();
    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
    renderer.setLegendItemToolTipGenerator(
        new StandardXYSeriesLabelGenerator("Legend {0}"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can generate a few lines of code that will do this but I'm
In C# I can generate random number from a string like this: public string
Hovering over option in a select list (window ) in IEs does not generate
I know I can use GUID to generate a unique string, but it's too
I can generate my models and schema.yml file based on an existing database. But
Disclaimer: I realize I can generate this at runtime in Java, this was needed
Is there an IDE out there that can generate XML from XSD? Not Oxygen
I can generate the controls but can't remove them. I'm trying to add a
Question: Can CMake generate build scripts that do not, in any way, use CMake?
I know that I can generate random floats with rand(max). I tried to generate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.