New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-charting

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-charting

Charts for react-native using Echarts

latest
Source
npmnpm
Version
1.0.8
Version published
Weekly downloads
1
-96.43%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-charting

Originally forked from native-echarts.

react-native-charting uses Echarts.

Works for both iOS & Android using WebView.

Install

$ yarn add react-native-charting

react-native-webview is a peer dependency. If you are not already using it in your project, then please go here to install it too react-native-webview

Android

Copy ./node_modules/react-native-charting/src/components/Echarts/echart.html to ./android/app/src/main/assets/. Don't remove ./node_modules/react-native-charting/src/components/Echarts/echart.html.

iOS

Nothing else to do.

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.
  • onPress (function): Returns event object.
  • onDataZoom (function): Returns event object.
import React, { Component } from 'react'
import { AppRegistry, StyleSheet, Text, View } from 'react-native'
import Echarts from 'react-native-charting'

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 (
      <Echarts
        option={option}
        height={300}
        onPress={(params) => console.log(params)}
      />
    )
  }
}

AppRegistry.registerComponent('app', () => app)

IOS

image

Android

image

License

react-native-charting is released under the MIT license.

Keywords

react-native

FAQs

Package last updated on 05 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts