1.0.1 • Published 3 years ago

react-native-echarts-liquidfill v1.0.1

Weekly downloads
14
License
-
Repository
github
Last release
3 years ago

react-native-echarts-liquidfill

NPM Version NPM Version

English 简体中文

echarts-liquidfill based on echarts.

Getting started

$ npm install react-native-echarts-liquidfill --save

Rely

$ npm install react-native-webview --save

Usage

1.Base Usage

import React from 'react';
import { View } from 'react-native';
import RNEChartsLiquidFill from 'react-native-echarts-liquidfill';
export default function ChartsComponent() {
  const pieOption = {
    title: {
      text: '水球图',
      left: 'center'
    },
    series: [
      {
        type: 'liquidFill',
        data: [0.6],
        color: ['#afb11b'],
        itemStyle: {
          //普通样式
          opacity: 0.6
        },
        emphasis: {
          itemStyle: {
            //悬停样式
            opacity: 0.9
          }
        }
      }
    ]
  };

  return (
    <View style={{ height: 300, paddingTop: 25 }}>
      <RNEChartsLiquidFill height={250} onPress={tt => alert(tt)} option={pieOption} />
    </View>
  );
}

2.More Usage

Please visit Echarts-Gallery

Props

PropTypeDefaultDescription
heightnumber400Chart area height
optionobjectnullChart data configuration items, see details:https://echarts.apache.org/zh/option.html#title
backgroundColorstringtransparentChart background color
themeNamestring-There are only six officially available themes:vintage || dark || macarons || infographic || shine || roma

Method

Method nameParamsDescription
setNewOptionoptionReassign and render the chart
onPresscallbackDataChart click event, callbackData is the clicked data