问题
I would like to display the (x, y) location of the mouse pointer with respect the coordinate system of the current jfree chart. I would like to do this constantly even if the mouse pointer is not set on any part of the graph.
I know I can activate the tooltip the way explained here but that displays the mouse location only if the mouse is on top of a graph point. How can I see the XYs all the time next to mouse pointer (tooltip or something)?
回答1:
As shown here, the coordinates are in the MouseEvent
returned by getTrigger()
in the ChartMouseEvent
sent to a ChartMouseListener
.
来源:https://stackoverflow.com/questions/20893480/is-there-a-way-to-update-and-display-x-y-next-to-mouse-pointer-in-jfreechart