echarts for react-native
npm install @whir-react-native/echartsbash
npm install @whir-react-native/echarts react-native-webview --save
`
or
`bash
yarn add @whir-react-native/echarts react-native-webview
`
Usage
The Usage is complete consistent with Echarts
component props:
- _option_ (object): The option for echarts: Documentation。
- _width_ (number): The width of the chart. The default value is the outer container width.
- _height_ (number): The height of the chart. The default value is 400.
`js
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View } from "react-native";
import Echarts from "native-echarts";
export default class app extends Component {
render() {
const option = {
title: {
text: "ECharts demo",
},
tooltip: {},
legend: {
data: ["销量"],
},
xAxis: {
data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
},
yAxis: {},
series: [
{
name: "销量",
type: "bar",
data: [5, 20, 36, 10, 10, 20],
},
],
};
return ;
}
}
AppRegistry.registerComponent("app", () => app);
`
##Example
_run demo_
`
cd example
npm install
npm start
``