简体   繁体   English

Chaco中的事件处理

[英]Event Handling in Chaco

When hovering over a data point in Chaco, I would like a small text box to appear, with the text I desire. 将鼠标悬停在Chaco的数据点上时,我希望出现一个带有所需文本的小文本框。 Also, when I click on a data point (or close enough), I would like my program to take a certain action. 另外,当我单击一个数据点(或足够接近)时,我希望程序采取某种措施。

I have seen relevant parts of the Chaco documentation, but implementing them has proved to be difficult. 我已经看过Chaco文档的相关部分,但是事实证明,实施它们很困难。 Any help would be appreciated. 任何帮助,将不胜感激。

Focusing first on the first (hover->textbox) issue, can you better explain what you've tried so far and how it's not working? 首先关注第一个问题(悬停->文本框),您能否更好地解释您到目前为止已经尝试了什么以及它如何不起作用? Eg, 例如,

from enthought.enable.tools import hover_tool

tool = hover_tool.HoverTool(theplot, callback=showtext)

etc? 等等? There's a more complex example of hover-tool use here (shows a PlotToolbar rather than just a textbox) which you might be able to adapt. 有悬停工具使用更复杂的例子在这里 (显示PlotToolbar,而不仅仅是一个文本框),你也许能够适应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM