TradingPal / react-native-highcharts

📈 Add Highcharts charts to react-native app for IOS and Android
https://github.com/TradingPal/react-native-highcharts
256 stars 158 forks source link

Not working on real device #4

Closed capurunep closed 7 years ago

capurunep commented 7 years ago

Hi, I am evaluating react-native-highcharts. It works fine in emulator however its not working on real device. I tried with Samsung-Android. Could you please suggest how to make it work on real device..

Best regards, Puru

Infinity0106 commented 7 years ago

we had the same problem we added domStorageEnable={true} on the webview tag, try getting the latest version and try to exportit

capurunep commented 7 years ago

Hi, I am using ChartView..will it work on ChartView as well? I tried with this one and still shows html text on mobile device instead of chart. I used domStorageEnable attribute as:

and also set: exporting: { enabled: true }

Thanks, Puru

donaldmorton commented 7 years ago

any error log ?

capurunep commented 7 years ago

On Mobile device, only it renders plain HTML text instead of charts. however, no any error displays.

jonrh commented 7 years ago

I'm having the same issue on iOS. In my case I was using v0.0.1 (named react-native-chart-view back then) and it worked fine until recently. I have not been able to figure out what changed.

I tried upgrading to react-native-highcharts v0.1.1 but the issue remains. I also tried the latest version in the GitHub repository but to no avail. It works correctly in the simulator and when built for Debug (I'm doing an iOS app). What does not work is when the app is built for Release. I have not been able to find any error logs. If I figure something out I'll update or comment again in this issue.

Update: After trial and error I believe I've isolated the issue (that I'm having at least) to functions being present in the Highcharts configuration object. When I remove the functions the chart works as expected in react-native-chart-view v0.0.1. The functions I had were as follows:

let highchartConfig = {
    // other Highcharts configurationi options    

    tooltip: {
        formatter: function() {
            // I also tried with no success: return "<b>"+ this.y +"%</b>";
            return `<b>${this.y}%</b>`;
        },
    },

    series: [{
        name: "Name of series", // not important
        data: [1, 2, 3, 4, 5], // not important
    },
    events: {
          // Disable the ability to click the series legend below the chart
          legendItemClick: () => { return false; },
    },
}
salujaharkirat commented 7 years ago

its working fine for me on IOS actually.

jonrh commented 7 years ago

@jinxac Does your Highcharts configuration object have any functions?

salujaharkirat commented 7 years ago

I havent use any functions yet.. just read your comment and see that issue comes while using functions

donaldmorton commented 7 years ago

Hi @jonrh, you can use this technique to debbug webviews on running devices this could give us more information on what's going on http://stackoverflow.com/questions/6508313/javascript-console-log-in-an-ios-uiwebview

feoktistov-kir commented 7 years ago

This problem actual for me. I added domStorageEnable={true}, but result show html text

feoktistov-kir commented 7 years ago

I update highcharts and added domStorageEnable={true}. Now application work only in debug release.

cgcanceran commented 7 years ago

Same issue I've encountered, react-native-highcharts 0.1.1 is working fine in emulator and debug release but not in the signed release.. Is there anyone knows the solution for this?

jonrh commented 7 years ago

@Noiwex Thanks for your input. This is indeed what I suspect is the root cause. Could you please create a pull request to handle it better? Or how would you approach solving this issue?

nkov commented 7 years ago

@Noiwex @jonrh You were right, it was this 'parsing' that caused the issue in iOS release mode (at least for me). My attached pr (#9) fixes this issue by parsing it a different way.

jonrh commented 7 years ago

Awesome, thanks @nkov! I'll try to get around to testing your implementation as soon as I can, hopefully tomorrow but it may be few days. Thanks again 👏

d12544 commented 5 years ago

having the same issue for waterfall chart. works fine on emulator but not on physical device.