All Projects β†’ genexu β†’ react-native-pie-chart

genexu / react-native-pie-chart

Licence: MIT license
Simple pie chart module for your React Native app

Programming Languages

typescript
32286 projects
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language
Starlark
911 projects
shell
77523 projects

Projects that are alternatives of or similar to react-native-pie-chart

Vue Chartjs
πŸ“Š Vue.js wrapper for Chart.js
Stars: ✭ 4,554 (+4850%)
Mutual labels:  pie, doughnut
Graph-Kit
πŸ“Š Android library for plotting and editing graphs πŸ“ˆ
Stars: ✭ 25 (-72.83%)
Mutual labels:  pie-chart
Caroline
A simple Cairo Chart Library for GTK and Vala
Stars: ✭ 41 (-55.43%)
Mutual labels:  pie-chart
React Fast Charts
Blazing Fast Charting Library in React with loading time less than 50ms
Stars: ✭ 113 (+22.83%)
Mutual labels:  pie-chart
Reaviz
πŸ“Š Data visualization library for React based on D3
Stars: ✭ 1,141 (+1140.22%)
Mutual labels:  pie-chart
Orcharts
ι₯ΌηŠΆε›Ύγ€ηŽ―ε½’ε›Ύγ€ζ‰‡ε½’ε›Ύγ€ζ›²ηΊΏε›Ύγ€ζŠ˜ηΊΏε›Ύ
Stars: ✭ 125 (+35.87%)
Mutual labels:  pie-chart
Jhchart
Stars: ✭ 593 (+544.57%)
Mutual labels:  pie-chart
ping
πŸ“Š Your very own Google Analytics replacement, without all of the Google. Simple as pie.
Stars: ✭ 93 (+1.09%)
Mutual labels:  pie
extrude
πŸ•΅οΈ Analyse binaries for missing security features, information disclosure and more...
Stars: ✭ 51 (-44.57%)
Mutual labels:  pie
Core Animation Pie Chart
Pie Chart built using CAShapeLayers, a CADisplayLink and custom layer properties
Stars: ✭ 107 (+16.3%)
Mutual labels:  pie-chart
Vue Css Donut Chart
Lightweight Vue component for drawing pure CSS donut charts
Stars: ✭ 104 (+13.04%)
Mutual labels:  pie-chart
Muze
Composable data visualisation library for web with a data-first approach now powered by WebAssembly
Stars: ✭ 1,153 (+1153.26%)
Mutual labels:  pie-chart
React D3 Components
D3 Components for React
Stars: ✭ 1,599 (+1638.04%)
Mutual labels:  pie-chart
Piechart
Simple and elegant pie chart for iOS applications
Stars: ✭ 45 (-51.09%)
Mutual labels:  pie-chart
chartjs-plugin-piechart-outlabels
Highly customizable Chart.js plugin that displays labels outside the pie/doughnut chart.
Stars: ✭ 46 (-50%)
Mutual labels:  pie
Dypiechartview
Animated Pie Chart using Custom CALayer.
Stars: ✭ 5 (-94.57%)
Mutual labels:  pie-chart
Highcharts Chart
Polymer Element wrapper for highcharts library. Seamlessly create various types of charts from one element.
Stars: ✭ 97 (+5.43%)
Mutual labels:  pie-chart
Tty Pie
Draw pie charts in your terminal window
Stars: ✭ 125 (+35.87%)
Mutual labels:  pie-chart
PieCharts
Easy to use and highly customizable pie charts library for iOS
Stars: ✭ 501 (+444.57%)
Mutual labels:  pie-chart
AndroidTableauLibrary
AndroidTableauLibrary is an Android SDK library supports variety of analytic graphs which developers simply integrate on Android project. - by @sung2063
Stars: ✭ 53 (-42.39%)
Mutual labels:  pie-chart

react-native-pie-chart

npm version npm downloads license

Simple pie chart module for your React Native app, for both iOS and Android.

Installation

You need to have react, react-native and @react-native-community/art as your app's dependencies.

~$ npm install react-native-pie-chart --save

For react-native versions older than 0.60 you need to manually install and link @react-native-community/art:

~$ npm install @react-native-community/art --save
~$ react-native link @react-native-community/art

Refer to their project repository for more information: https://github.com/react-native-art/art

Usage

Here's a quick start code. Refer to the example directory for a fully working app.

import React, { Component } from 'react';
import { StyleSheet, ScrollView , StatusBar, Text, View } from 'react-native';
import PieChart from 'react-native-pie-chart';

export default class TestChart extends Component {
  render() {
    const widthAndHeight = 250
    const series = [123, 321, 123, 789, 537]
    const sliceColor = ['#F44336','#2196F3','#FFEB3B', '#4CAF50', '#FF9800']

    return (
      <ScrollView style={{flex: 1}}>
        <View style={styles.container}>
          <Text style={styles.title}>Basic</Text>
          <PieChart
            widthAndHeight={widthAndHeight}
            series={series}
            sliceColor={sliceColor}
          />
          <Text style={styles.title}>Doughnut</Text>
          <PieChart
            widthAndHeight={widthAndHeight}
            series={series}
            sliceColor={sliceColor}
            doughnut={true}
            coverRadius={0.45}
            coverFill={'#FFF'}
          />
        </View>
      </ScrollView>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center'
  },
  title: {
    fontSize: 24,
    margin: 10
  }
});

Example App

Have a look at the app in the example directory for how to write a simple app that shows two charts. To setup and run the example app follow these instructions:

# Clone package
~$ git clone https://github.com/genexu/react-native-pie-chart.git

# Setup ART and dependencies
~$ cd react-native-pie-chart/example
~$ npm install

# Run simulator
# Notice: plz make sure your simulator state is normal
~$ npx react-native run-ios
~$ npx react-native run-android

TypeScript

The npm package includes TypeScript types.

Upgrading from version one

The only breaking change between version one and two is chart_wh prop. It is renamed to widthAndHeight. Beside that, there shouldn't be any issue upgrading.

Props

Property Type Description Required Default
widthAndHeight Number chart width and height Yes
coverFill String doughnut cover fill color No #FFF
coverRadius Number doughnut cover radius No 0.6
doughnut Bool doughnut style No false
series Array < number > series data array Yes
sliceColor Array < string > series slice color array Yes
style Object pie chart style No {}

series should be a list of all positive (or zero) numbers. The sum of the series cannot be zero.

The size of the sliceColor array should be equal to the size of the series array.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].