Results 1 to 3 of 3
  1. #1
    getName() is offline Member
    Join Date
    Jun 2010
    Posts
    11
    Rep Power
    0

    Default jFreeChart highlight and click it

    Hi everybody,

    I would like to use a XYBlockchart with the following features:

    1. Highlight square when mouse is over it
    2. Show tooltip (which is simple, as far as I know - just setting a flag == true)
    3. Open an additional frame with a graph by double-clicking on a square

    So the questions are:

    Is highlighting possible at all (without too much effort)?
    How do I get the the closest data point to the position I am clicking onto?

    I would appreciate any help.

    Ben

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    Do you have the API doc for jFreeCharts?
    What does it say?

  3. #3
    getName() is offline Member
    Join Date
    Jun 2010
    Posts
    11
    Rep Power
    0

    Default

    Yes, there is a chartMouseListener.
    The difficulty is be to refer the returned coordinates to a chart entity. I mean to existing data and the reference to its origin within a dataset.
    Believe it or not, the Development Guide includes some examples for these topics. They are simply not listed in the overview tool. And the problem seems to be solved.

    Solutions can be found among the examples coming with the jFreeChart Development Guide:

    1. MouseOverDemo1.java
    2. JFreeChart chart = ChartFactory.createBlablaChart(...,true,...); // and the tooltip is on
    3. MouseListenerDemo1-4.java

    Thank you anyway

Similar Threads

  1. Highlight JTextField using Jbutton?
    By goffy in forum New To Java
    Replies: 11
    Last Post: 05-02-2010, 12:41 PM
  2. Replies: 0
    Last Post: 01-31-2010, 06:46 AM
  3. Highlight rows of a jtable
    By simmi in forum AWT / Swing
    Replies: 5
    Last Post: 08-20-2009, 02:13 PM
  4. How to Highlight a String in JTextArea
    By ramvaidhya in forum AWT / Swing
    Replies: 6
    Last Post: 12-31-2008, 08:23 AM
  5. GNU Source-highlight 2.7
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-12-2007, 09:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •