Open popup onclick of points in jchartfx

146 Views Asked by At

I want to open the popup on click of points in jchartfx to display the detail information about that point. I want to add the id attribute to the polygon tag. How can i pass the value of id to display the detail information dynamically?

1

There are 1 best solutions below

0
On

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, e.g.

Note that we inject properties to the event object sent in HTML that includes the hitType, the series index and the point index.

If you are using 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

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

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

Regards,

JuanC