简体   繁体   English

在jchartfx中打开点的弹出onclick

[英]Open popup onclick of points in jchartfx

I want to open the popup on click of points in jchartfx to display the detail information about that point. 我想在单击jchartfx中的点时打开弹出窗口,以显示有关该点的详细信息。 I want to add the id attribute to the polygon tag. 我想将id属性添加到多边形标签。 How can i pass the value of id to display the detail information dynamically? 如何传递id的值以动态显示详细信息?

We do not have the capability of adding id (or any other attributes) to the SVG elements but we use the sfxid attribute so that you can handle events on chart elements, eg 我们不具备向SVG元素添加id(或任何其他属性)的功能,但是我们使用sfxid属性,以便您可以处理图表元素上的事件,例如

Note that we inject properties to the event object sent in HTML that includes the hitType, the series index and the point index. 请注意,我们将属性注入到以HTML发送的事件对象中,该属性包括hitType,系列索引和点索引。

If you are using jQuery 如果您使用的是jQuery

   $("#myDiv").click(function(evt) {
         if (evt.hitType == cfx.HitType.Point) {
             var s = "Series " + evt.series + " Point " + evt.point;
             alert(s);
         }
    }

If you are not using jQuery 如果您不使用jQuery

  var divHolder = document.getElementById('myDiv');
  chart1.create(divHolder);
  divHolder.onclick = doClick;

   function doClick(evt)
    {
        alert("Series " + evt.series + " Point " + evt.point);
    }

Regards, 问候,

JuanC 胡安

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

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