![](/img/trans.png)
[英]How to use RegExp in React-Native Webview's injectedJavaScript prop?
[英]How to use Highcharts in React-Native using webview?
我想在 react-Native 的 webview 中呈現圖表。 我使用了 highcharts npm 包。
我定義了一個像這樣的 Webview
<WebView ref='webview' />
在 componentDidMount 中,我寫了
componentDidMount(){
var chart = Highcharts.chart(this.refs.webview,{
series: [{
data: [1, 3, 2, 4]
}],
// ... more options - see http://api.highcharts.com/highcharts
});
}
但它正在拋出錯誤。
誰能指出我在這里做錯了什么。 謝謝
我建議使用react-native-highcharts
或highcharts-react-native
npm 包。 它使用 react-native-highcharts 中的HigchchartsReactNative
組件和highcharts-react-native
中的ChartView
組件為您執行此操作。 我認為您正在編寫react-highcharts
的代碼並試圖將其放入WebView
中。 我不推薦這個。 這里有幾個鏈接
https://www.highcharts.com/blog/post/creating-mobile-charts-with-highcharts-react-native/
https://www.npmjs.com/package/react-native-highcharts
主要區別在於react-native-highcharts
是第三方包,支持大多數 highcharts 產品,如highstock
或highmaps
,而highcharts-react-native
僅支持highcharts
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.