Hello,
I'am a french student, so I'm sorry for my English.
I have a serie of point that I plot on a scatter JFreechart.
I would like to draw points by hand when I click on the graph and get back their coordinates.
Is it possible and how to do that ?
Thank you.
Have a good day.
Plot by hand on scatter plot
-
- Posts: 13
- Joined: Tue May 15, 2012 2:17 pm
- antibot: No, of course not.
Re: Plot by hand on scatter plot
Hi!
Drawing on charts is not directly supported by JFreeChart. However, Searching the forum got me to this post which might help you.
If this is not what you need, try searching for the ChartMouseListener interface.
hth,
- martin
Drawing on charts is not directly supported by JFreeChart. However, Searching the forum got me to this post which might help you.
If this is not what you need, try searching for the ChartMouseListener interface.
hth,
- martin
-
- Posts: 13
- Joined: Tue May 15, 2012 2:17 pm
- antibot: No, of course not.
Re: Plot by hand on scatter plot
Thank you for your reply.
In fact, I don't have to draw point when I click on the graph but I want to get back the coordinate of the mouse.
I try with
With this I can have the coordinates all over the frame when I click with the mouse exept when the mouse is on the graph.
So, I try with :
but this method is undefinied for JFreeChart.
Do you know how to do ?
In fact, I don't have to draw point when I click on the graph but I want to get back the coordinate of the mouse.
I try with
Code: Select all
frame1.addMouseListener(this);
So, I try with :
Code: Select all
chart1.addChartMouseListener(this);
Do you know how to do ?
Re: Plot by hand on scatter plot
Something like this:
- martin
Code: Select all
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.addChartMouseListener(this);
-
- Posts: 13
- Joined: Tue May 15, 2012 2:17 pm
- antibot: No, of course not.
Re: Plot by hand on scatter plot
Thank you, you're right.
That works.
That works.