user2312915
user2312915

Reputation: 39

How do I draw graphics on top a ChartPanel?

I have a ChartPanel object displaying some information, but I would like to be able to use a MouseListener interface to draw on top of it. I'd imagine I would just have to call some sort of "repaint()" method at the end of the interface methods and perform some override, but after spending considerable time researching I haven't a clue how to go about doing this. Is this even possible? Any insight or advice?

Upvotes: 0

Views: 92

Answers (1)

David Gilbert
David Gilbert

Reputation: 4477

You can create a class that implements the Overlay interface and then add it to the ChartPanel using the addOverlay(Overlay) method. Everything that the overlay draws will be drawn after (so on top of) the chart.

Upvotes: 2

Related Questions