问题描述
我想显示鼠标指针相对于当前jfree图表的坐标系的(x,y)位置.即使在图形的任何部分上都没有设置鼠标指针,我也希望不断地做到这一点.
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.
我知道我可以按照此处所述的方式激活工具提示,但该工具提示会显示仅当鼠标位于图形点上方时,鼠标才会位于该位置.我怎么一直都能看到鼠标指针(工具提示之类的东西)旁边的XY?
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)?
推荐答案
如此处所示,坐标位于由ChartMouseEvent
中的getTrigger()
返回的MouseEvent
发送到ChartMouseListener
.
As shown here, the coordinates are in the MouseEvent
returned by getTrigger()
in the ChartMouseEvent
sent to a ChartMouseListener
.
这篇关于有没有一种方法可以在jfreechart中更新并在鼠标指针旁边显示x y?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!