ECharts 升级

This commit is contained in:
veveue 2018-09-18 23:49:48 +08:00
parent 3767deeae3
commit aea8c0f0bd
9 changed files with 114 additions and 151 deletions

14
.gitignore vendored
View File

@ -1,2 +1,12 @@
/node_modules logs/
*.sh npm-debug.log
yarn-error.log
node_modules/
package-lock.json
yarn.lock
coverage/
.idea/
run/
.DS_Store
*.sw*
*.un~

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -26,6 +26,6 @@
}, },
"homepage": "https://github.com/somonus/react-native-echarts#readme", "homepage": "https://github.com/somonus/react-native-echarts#readme",
"dependencies": { "dependencies": {
"echarts": "3.2.3" "echarts": "^4.2.0-rc.1"
} }
} }

View File

@ -1,5 +1,5 @@
import React, { Component } from 'react'; import React, {Component} from 'react';
import { View } from 'react-native'; import {View} from 'react-native';
import styles from '../../style'; import styles from '../../style';
export default class App extends Component { export default class App extends Component {

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
import React, { Component } from 'react'; import React, {Component} from 'react';
import { WebView, View, StyleSheet, Platform } from 'react-native'; import {WebView, View, StyleSheet, Platform} from 'react-native';
import renderChart from './renderChart'; import renderChart from './renderChart';
import echarts from './echarts.min';
export default class App extends Component { export default class App extends Component {
@ -12,7 +11,7 @@ export default class App extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if(nextProps.option !== this.props.option) { if (nextProps.option !== this.props.option) {
this.refs.chart.reload(); this.refs.chart.reload();
} }
} }
@ -26,8 +25,8 @@ export default class App extends Component {
<View style={{flex: 1, height: this.props.height || 400,}}> <View style={{flex: 1, height: this.props.height || 400,}}>
<WebView <WebView
ref="chart" ref="chart"
scrollEnabled = {false} scrollEnabled={false}
injectedJavaScript = {renderChart(this.props)} injectedJavaScript={renderChart(this.props)}
style={{ style={{
height: this.props.height || 400, height: this.props.height || 400,
backgroundColor: this.props.backgroundColor || 'transparent' backgroundColor: this.props.backgroundColor || 'transparent'

View File

@ -1,4 +1,3 @@
import echarts from './echarts.min';
import toString from '../../util/toString'; import toString from '../../util/toString';
export default function renderChart(props) { export default function renderChart(props) {

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, {Component} from 'react';
import { WebView, View } from 'react-native'; import {WebView, View} from 'react-native';
import { Container, Echarts } from './components' import {Container, Echarts} from './components'
export default class App extends Component { export default class App extends Component {