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.
How do I draw graphics on top a ChartPanel?
-
29-09-2022 - |
Question
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?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow