Comments (10)
I had noticed this as well (in the code & delay) and am in favour of having the needed dependencies be baked into the eventual React Native bundle JS file (if possible), i.e. no extra network requests. It would also be of benefit for offline apps. I suspect this might come down to licences.
I've been playing a bit around with the code and I believe that jQuery is not needed. As far as I can tell the only thing jQuery is used for as of now is to register a document ready callback. As seen here:
$(function () {
Highcharts.stockChart('container', highchartConfigObject);
});
Without being 100% I think this could be replaced as such and no longer needing the jQuery dependency:
document.addEventListener("DOMContentLoaded", function() {
Highcharts.chart('container', highchartConfigObject);
});
from react-native-highcharts.
Have you considered wrapping Highcharts with react-highcharts?
from react-native-highcharts.
Hi everyone!
Does anyone have any hints on how to use offline bundles instead?
from react-native-highcharts.
Update: Please ignore, will probably not work. See reply below.
@mmazzarolo One dirty way would be to modify the file react-native-ChartView.js
. There you could swap out line 38
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
with:
<script>put the contents of the https://code.jquery.com/jquery-2.1.4.min.js file here</script>
You would then do this for all the <script> tags that include remote JavaScript source files. This is one quick and dirty way to do it until this library would have native support for it. Hope it helps!
from react-native-highcharts.
Thanks, I thought there was some kind of native implementation for the RN webview but I guess that the easier solution is still the manual replacement :)
from react-native-highcharts.
@jonrh I have tried that way - Put the content of highcharts.js into script tag, remove script jquery by your suggestion. But the chart was not render. have you tried that way?
from react-native-highcharts.
@minhquankq I'm very sorry, you're right. After your reply I remembered I did once try it and it failed, confused it with something else. If I remember correctly there were a lot of characters that needed to be escaped for that to work (too much trouble IMO).
I think the long-term solution would be to use the highcharts package on npm. I haven't attempted it though.
from react-native-highcharts.
I tried to implement it with downloaded libraries, I tried with highcharts and highstock and I could run it but when I imported the text for jquery some weird error came up, so I leave it like that, but if you want i cant upload the version with static highcharts and static highstock
from react-native-highcharts.
@Infinity0106 Thanks for your update. In my attempts I was able to get rid of the jQuery dependency with the following code (see my reply above):
document.addEventListener("DOMContentLoaded", function() {
Highcharts.chart('container', highchartConfigObject);
});
from react-native-highcharts.
Check out my comments on #54 I put some hits there on how we got it to work. @mmazzarolo
from react-native-highcharts.
Related Issues (20)
- Highchart 1.0.2 not rendering properly in real device in react-native 0.57.8 HOT 5
- Multiple Chart on the same View
- the events callback functions can`t do console.log(1) but can alert(1)
- High Chart is not supporting in React Native HOT 1
- Is it possible to use 'nodata' with the react native version?
- Charts not show data HOT 4
- Invalid SemVer Version HOT 2
- Is there any way of implementing Organisation chart ?
- the chart is not rendering in ios. HOT 4
- WebView has been removed from React Native. HOT 4
- charts not visible ... HOT 7
- Can't access external variables inside events.load method and I want to access all the highchart apis outside the scope, please help HOT 3
- Show loading before the charts is loaded,
- Can't use word cloud in this package
- Tooltip not showing on Android but on iOS it does.
- variablepie chart not working HOT 1
- Time and Date both are not showing on X-Axis.
- Highlight chart Organizational hierarchy
- Data Points(Marker as a SVG) do not fully render when compiling Android Build HOT 1
- Unable to sync zooming of multiple charts.Is there any choice to sync zoom of charts in React native.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-highcharts.