Click event on Fusioncharts in iOS

452 views Asked by At

I have a StackedBar 2D graph using FusionCharts in native iOS app where I am plotting a bar chart. On click of single bar plot, I have to redirect user to previous screen by calling a native function. I am using "link" attribute in FusionCharts as:
data:

{
    "link": "j-showAlert";
}

And in the script tag of FusionCharts I have written a showAlert function. But click event is not triggering. Please help me on this.

2

There are 2 answers

0
sikrigagan On BEST ANSWER

Please check if function call is blocked or not allowed in Xcode Application Debugger.

Alternatively, you can use FusionCharts API events and methods (dataPlotClick) for this. You can also get details respective to dataPlot clicked via event parameters.

"events": {
  "dataPlotClick": function(ev, props) {
    showAlert();
    function showAlert() {
        alert("Data Plot Clicked: " + props.toolText);
    }
  }

Please check this JSFiddle sample.

To know more about this event, please check this documentation page: http://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-events.html#event-dataplotClick

2
Alireza Asadi On
    "events": {
      "dataPlotClick": function(ev, props) {
        //write your code
      }
   }