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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...