简体   繁体   English

通过缩放画布单击点标签

[英]Click on point labels through zoom canvas

I have onclick event on point labels. 我在点标签上有onclick事件。 Works fine on IE8+, Firefox and Chrome. 在IE8 +,Firefox和Chrome上正常运行。 Zoom also works fine. 缩放也可以。

But on IE7, IE6 I can't click on point labels because we have jqplot-event-canvas and jqplot-zoom-canvas and others on front. 但是在IE7,IE6上,我无法单击点标签,因为我们jqplot-event-canvasjqplot-event-canvasjqplot-zoom-canvas等。

When I increase z-index for <DIV class="chartPointWrapper"> ... </div> we can click on point labels. 当我增加<DIV class="chartPointWrapper"> ... </div> z-index ,我们可以单击点标签。 But zoom is not working. 但是变焦不起作用。

Do you know any solution to handle chart zoom and onclick event on point labels? 您是否知道解决点标签上的图表缩放和onclick事件的任何解决方案?

Thanks. 谢谢。

The solution to your problem, I believe, is in EDIT2 of my answer to a similar problem . 我相信,您的问题的解决方案是在我对类似问题的答案的EDIT2中 Effectively, you must apply z-index to all canvas appropriately so they preserve they intended order. 有效地,您必须将z-index适当地应用于所有画布,以便它们保留预期的顺序。

For answer to question in @Swapnil Chincholkar 's comment above, please see this code sample . 有关上述@Swapnil Chincholkar评论中问题的答案,请参见此代码示例 It shows how you can use the jqplotClick to detect clicks on the points. 它显示了如何使用jqplotClick来检测对点的单击。 As you could read here only when you are on or close to a point the neighbor variable is not null. 正如您在此处只能阅读的那样,当您在某个点上或附近时, neighbor变量不为null。 You could observe that the highlighter plugin uses the neighbor variable in the same way to show its tooltip. 您可以观察到荧光笔插件以相同的方式使用neighbor变量来显示其工具提示。

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

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