A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
Manu22
Post
by Manu22 » Wed Aug 25, 2004 3:56 pm
Hello,
i would like user could click on 1 item in the legend and a color window appears to change the color of this line.
How can i do it ??
How can i check if the user clicked on the legend bar ?
Thanks
Manu
-
RCDran
- Posts: 29
- Joined: Wed Feb 25, 2004 4:18 am
- Location: Japan
Post
by RCDran » Thu Aug 26, 2004 5:57 am
You may listen to the chartmouselistener and get the x,y co-ordinates and using that get the legend entiry and call the color chooser.
I have not done this personally, just an idea and perhaps there may be a better idea than this.
--
RCDran
-
Manu22
Post
by Manu22 » Fri Aug 27, 2004 8:12 am
RCDran wrote:You may listen to the chartmouselistener and get the x,y co-ordinates and using that get the legend entiry and call the color chooser.
I have not done this personally, just an idea and perhaps there may be a better idea than this.
The problem is that if the window is of different sizes, it will show me differents values of X,Y.
-
RCDran
- Posts: 29
- Joined: Wed Feb 25, 2004 4:18 am
- Location: Japan
Post
by RCDran » Sat Aug 28, 2004 11:21 am
X,Y will be the co-ordinates of the mouse's location which does not matter how much ever the window size is. If you are going to re-size the window then the x,y you get is dtill the x,y of the mouse's location. So I think you can give a try.
--
RCDran