Results 1 to 2 of 2
  1. #1
    fyaxic is offline Member
    Join Date
    Aug 2011
    Rep Power

    Default [jFreeChart] Converting screen-points to points, which are relative to the axis


    I'm playing a bit around with jFreeChart. What I would like to do is, to klick onto the graph and get the coordinates (within the graph), which i klicked on.

    I found the method mouseClicked(MouseEvent e) within the ChartPanel Class.
    e.getX() gives me a number relative to the window.
    Now i searched around and tried many ways to, from there, get the coordinates i clicked on. Anyways, I was not able to find a method which suited that propose.

    There exists a method called translateScreenToJava2D(Point p), which sounds just like what I'm saerching for, but it does not return the wished value.

    Do you have a suggestion for me, which way I could use?


  2. #2
    fyaxic is offline Member
    Join Date
    Aug 2011
    Rep Power

    Default Solved

    I do not know whether this is the "normal" way to get the coords, but I found a solution:
    The Class ChartEntity has a tooltip field, which contains, as a String, the Coordinates and the name of the dataset.

Similar Threads

  1. ReScaling of Log axis using JFreeChart
    By The Vicky in forum AWT / Swing
    Replies: 1
    Last Post: 03-22-2011, 07:17 AM
  2. Java Points help
    By Jcbconway in forum Advanced Java
    Replies: 30
    Last Post: 10-27-2010, 12:25 AM
  3. Replies: 5
    Last Post: 10-01-2010, 09:26 PM
  4. How to Customize Jfreechart value axis?
    By neeraj.singh in forum AWT / Swing
    Replies: 0
    Last Post: 02-16-2009, 08:57 AM
  5. Replies: 2
    Last Post: 08-24-2008, 12:30 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