Sign in to follow this  
mkollipara

Unable to call JavaScript method on click of Column in Column 2D chart.

Recommended Posts

hi, 

I am trying to call javascript method onclick of column  in column 2d chart but it is not working. Can you please help.

Below is code that I am trying to use.

HTML code :

<html>
  <head>
    <title>JavaScript Link Example</title>
    <script language="JavaScript" src="../../../Charts/FusionCharts.js"></script>
    <SCRIPT LANGUAGE="JavaScript"><!--
      function myJS(myVar){
          window.alert(myVar);
      }
    // --></SCRIPT>
  </head>
  <body bgcolor="#ffffff">
    <div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div>
    <script type="text/javascript"><!--
        var myChart = new FusionCharts("../../../Charts/Column2D.swf", 
        "myChartId", "500", "300", "1", 
        "1");
       myChart.setXMLUrl("JSExample.xml");
       myChart.render("chartdiv");
    // --></script>
  </body>
</html>
 
 
 
XML data:
<chart caption='ABC Bank Branches' subCaption='(In Asian Countries)' yaxislabel='Branches' xaxislabel='Country'>
    <set label='Hong Kong' value='235' link="JavaScript:myJS('Hong Kong,235');"/>
    <set label='Japan' value='123' link="Callback.html" />
    <set label='Singapore' value='129' /> 
    <set label='Malaysia' value='121'/>
    <set label='Taiwan' value='110' /> 
    <set label='China' value='90' />  
    <set label='S. Korea' value='86' />  
</chart>

 

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