Open Clearwyx opened 5 years ago
最新版的rn,无法正常运行demo
"dependencies": { "@antv/f2": "^3.5.0-beta.1", "react": "16.9.0", "react-native": "0.61.5", "react-native-canvas": "^0.1.34", "react-native-webview": "^7.6.0" },
最新版的rn,无法正常运行demo
"dependencies": { "@antv/f2": "^3.5.0-beta.1", "react": "16.9.0", "react-native": "0.61.5", "react-native-canvas": "^0.1.34", "react-native-webview": "^7.6.0" },
Hi, you can use the getContext('2d')
, like this:
const context = await canvas.getContext('2d')
new F2.Chart({
context: context
})
await
is necessary, as it has been written in the react-native-canvas
readme.
Although it works now. But when i requie the @antv/f2/lib/interaction/interaction/
, another problem occurred: document is not defined
.
So, i might need to try another chart library.
1.安装 antv/f2 npm install @antv/f2 --save
2.安装 react-native-canvas npm install react-native-canvas
3.安装 react-native-webview npm install react-native-webview --save react-native link react-native-webview