java - JFreeChart XYPlot XYImageAnnotation mouse click listener -
i have jfreechart
2 subplots (xyplot).
i have xyimageannotation
s want become buttons, can't find way listen mouse click on annotation.
do know way this?
i have no idea how listen [for] click annotations
in chartmouselistener
, you'll chartmouseevent
. use chartentity
that's xyannotationentity
.
chartpanel.addchartmouselistener(new chartmouselistener() { @override public void chartmouseclicked(chartmouseevent cme) { chartentity ce = cme.getentity(); if (ce instanceof xyannotationentity) { // handle click } } }
otherwise, xyitementity
added annotation.
Comments
Post a Comment