Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataPlotClick event not triggering in Android for React Native #139

Open
VibhorKockpit opened this issue Dec 24, 2021 · 1 comment
Open

Comments

@VibhorKockpit
Copy link

Hi, I am trying to implement 2D scrollable column chart in a test project, everything has worked fine till now in case of iOS but for Android, my dataPlotClick event if not getting triggered. I am using following versions of the package.

"react-native-webview": "^11.0.2",
"react-native-fusioncharts": "^5.1.0", 
"fusioncharts": "^3.18.0",

Here is my chart config and library path:

const chartConfigs = {
    type: "scrollColumn2d",
    width: "100%",
    height: "200",
    dataFormat: "json",
    dataSource: {
      chart: {
        theme: "fusion",
        showvalues: "1",
        showToolTip: "0",
        numberprefix: "$",
        scrollheight: "0",
        flatScrollBars: "0",
        numVisiblePlot: "4",
        showHoverEffect: "1",
        scrollShowButtons: "0",
        scrollColor: "#cccccc",
        showBorder: "0",
        bgColor: "#ffffff",
        showYAxisvalue: "0",
        canvasPadding: "10",
        showXAxisLine: "1",
      },
      categories: [
        {
          category: graphLabel,
        },
      ],
      dataset: [
        {
          data: graphValue,
        },
      ],
    },
    events: {
      dataPlotClick: function (ev, props) {
        barClick();
        function barClick() {
          handleClick(props?.categoryLabel);
        }
      },
    },
  };

  const libraryPath = Platform.select({
    // Specify fusioncharts.html file location
    ios: require("../../../assets/FusionCharts/fusioncharts.html"),
    // ios: require('../../../assets/fusioncharts.html'),
    android: { uri: "file:///android_asset/fusioncharts.html" },
  });

The graph is rendering correctly in Android and iOS, it's just that events are not getting triggered on Android.

This is what I get in my Android Logcat.

2021-12-24 13:36:25.738 22228-22228/com.test I/ViewRootImpl@7e78e8e[MainActivity]: ViewPostIme pointer 0
2021-12-24 13:36:25.831 22228-22228/com.test I/ViewRootImpl@7e78e8e[MainActivity]: ViewPostIme pointer 1
2021-12-24 13:36:25.863 22228-22228/com.test D/InputMethodManager: prepareNavigationBarInfo() DecorView@37fc448[MainActivity]
2021-12-24 13:36:25.863 22228-22228/com.test D/InputMethodManager: getNavigationBarColor() -16711423
2021-12-24 13:36:25.863 22228-22228/com.test V/InputMethodManager: Starting input: tba=com.test ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2021-12-24 13:36:25.863 22228-22228/com.test D/InputMethodManager: startInputInner - Id : 0
2021-12-24 13:36:25.863 22228-22228/com.test I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
2021-12-24 13:36:25.866 22228-22228/com.test D/InputTransport: Input channel constructed: 'ClientS', fd=218
2021-12-24 13:36:25.866 22228-22228/com.test D/InputTransport: Input channel destroyed: 'ClientS', fd=112
2021-12-24 13:36:25.866 22228-22228/com.test D/InputMethodManager: HSIFW - flag : 0
2021-12-24 13:36:45.001 22228-22228/com.test I/ViewRootImpl@7e78e8e[MainActivity]: ViewPostIme pointer 0
2021-12-24 13:36:45.083 22228-22228/com.test I/ViewRootImpl@7e78e8e[MainActivity]: ViewPostIme pointer 1
2021-12-24 13:36:45.106 22228-22228/com.test D/InputMethodManager: HSIFW - flag : 0
@AyanBhadury
Copy link

Library path prop is not required any react-native-fusioncharts can you double check if you are using version 5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants