Jump to content
JChartFX Community
  • 0
Sign in to follow this  
swatipatel

Open popup on click of points in jchartfx

Question

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?

post-47072-0-83770300-1420023783_thumb.png

Edited by swatipatel

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×