bar chart high light

Discussion about JFreeChart related to stockmarket charts.
Locked
nimmi
Posts: 1
Joined: Mon Nov 24, 2003 3:22 pm

bar chart high light

Post by nimmi » Mon Nov 24, 2003 11:16 pm

I Have a barChart with only one series. I would like to hightlight the bar or change color on mouse click . I also want to record the x-y values.
Any help will be greatky appreciated.
Thanks

blueland9999
Posts: 5
Joined: Sun Nov 14, 2004 3:23 am

Post by blueland9999 » Sun Nov 14, 2004 10:44 pm

Have you already got the answer?
Can you tell me , how can i do it?
I have the same question.

Thanks!

Ming

MNusinov
Posts: 15
Joined: Tue Jul 03, 2007 7:41 pm

Post by MNusinov » Tue Jul 17, 2007 4:01 pm

I also want to record the x-y values.
If you had a ChartMouseListener to the ChartPanel you can use the event:

public void chartMouseClicked(ChartMouseEvent e)

to get the x-y values for a clicked on item.

Code: Select all

XYItemEntity xyItem = (XYItemEntity)e.getEntity();
xyItem.getDataset().getX(xyItem.getSeriesIndex(), xyItem.getItem());
xyItem.getDataset().getY(xyItem.getSeriesIndex(), xyItem.getItem());
As far as changing the color, I'm not sure on that but would like to know if anyone else has figured it out.

jwenting
Posts: 157
Joined: Sat Jul 15, 2006 7:46 am

Post by jwenting » Wed Jul 18, 2007 9:49 am

I somehow doubt they'er still waiting for an answer after nearly 4 years :)

MNusinov
Posts: 15
Joined: Tue Jul 03, 2007 7:41 pm

Post by MNusinov » Thu Jul 19, 2007 2:52 pm

Crap I didn't see the date, I was using the search tool and stumbled upon this thread while trying to find an answer to something else. Now don't I have egg on my face?

jwenting
Posts: 157
Joined: Sat Jul 15, 2006 7:46 am

Post by jwenting » Fri Jul 20, 2007 6:28 am

supposed to be good for the skin, egg on your face.

AxiomShell
Posts: 1
Joined: Mon Mar 17, 2008 6:15 pm

Post by AxiomShell » Mon Mar 17, 2008 6:18 pm

MNusinov wrote:Crap I didn't see the date, I was using the search tool and stumbled upon this thread while trying to find an answer to something else. Now don't I have egg on my face?
Well, nearly 1 year after your reply, I have to tell you I don't see any problem. :)

I also stumbled on your answer today using a search engine, and I found it very useful.

cheers!

Locked