All Projects → mskec → react-native-mp-android-chart

mskec / react-native-mp-android-chart

Licence: MIT license
React Native wrapper of popular android charting library MPAndroidChart

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

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

ipychart
The power of Chart.js with Python
Stars: ✭ 48 (-5.88%)
Mutual labels:  charts
PandasVersusExcel
Python数据分析入门,数据分析师入门
Stars: ✭ 120 (+135.29%)
Mutual labels:  charts
vistime
Pretty timelines in R.
Stars: ✭ 133 (+160.78%)
Mutual labels:  charts
KLineChartAndroid
A kline chart UI widget for android(Android版本的k线).
Stars: ✭ 51 (+0%)
Mutual labels:  charts
JMeter-Charts
Application used to generate reports by uploading a JTL file to a rest server
Stars: ✭ 19 (-62.75%)
Mutual labels:  charts
vue3-charts
Vue3-Charts is an SVG-based charting library that is very easy to use and highly customizable
Stars: ✭ 86 (+68.63%)
Mutual labels:  charts
beapi-bench
Tool for benchmarking apis. Uses ApacheBench(ab) to generate data and gnuplot for graphing. Adding new features almost daily
Stars: ✭ 16 (-68.63%)
Mutual labels:  charts
Mtgdb
Mtgdb.Gui - desktop app to search MTG cards and build decks
Stars: ✭ 46 (-9.8%)
Mutual labels:  charts
nettemp
Interface for controlling the temperature sensors DS18B20, supports; serial DS9097, usb DS9097U, usb DS2490, Raspberry Pi GPIO
Stars: ✭ 53 (+3.92%)
Mutual labels:  charts
slope
C/Gtk+ data visualization library.
Stars: ✭ 91 (+78.43%)
Mutual labels:  charts
SwiftCharts
Easy to use and highly customizable charts library for iOS
Stars: ✭ 2,405 (+4615.69%)
Mutual labels:  charts
elementary-plotlib
C/C++ Plotting Library
Stars: ✭ 19 (-62.75%)
Mutual labels:  charts
chart-testing-action
A GitHub Action to lint and test Helm charts
Stars: ✭ 139 (+172.55%)
Mutual labels:  charts
ggwaffle
Creating waffle charts in a ggplot friendly way
Stars: ✭ 45 (-11.76%)
Mutual labels:  charts
oxyplot-avalonia
A cross-platform plotting library for .NET. This package targets Avalonia apps.
Stars: ✭ 102 (+100%)
Mutual labels:  charts
trakttvstats
A chrome extension adding various improvements to trakt.tv
Stars: ✭ 23 (-54.9%)
Mutual labels:  charts
o-fish-web
Web application for the Officer's Fishery Information Sharing Hub (O-FISH). The web app allows agencies to gain insights from the aggregated information gathered during a routine vessel inspection (submitted via the web app).
Stars: ✭ 29 (-43.14%)
Mutual labels:  charts
gopherjs-frappe-charts
[experimental/outdated; frappe v0.07] GopherJS bindings for frappe/charts - simple Go charts for your frontend
Stars: ✭ 20 (-60.78%)
Mutual labels:  charts
Samples-ASP.NET-MVC-CSharp
ASP.NET MVC C# samples for Stimulsoft Reports.Web reporting tool.
Stars: ✭ 31 (-39.22%)
Mutual labels:  charts
apexcharts-flow
ApexCharts.js wrapper for the Vaadin Platform
Stars: ✭ 43 (-15.69%)
Mutual labels:  charts

⚠️ Not maintained ⚠️

Please use https://github.com/wuxudong/react-native-charts-wrapper

React Native MPAndroidChart

This library is React Native wrapper of popular Android charting library MPAndroidChart.

Table of contents

Setup

Library can be easily installed using NPM:

npm i react-native-mp-android-chart --save

Additional setup is required because library is using native Android code.

android/build.gradle

allprojects {
    repositories {
        ...

        maven { url "https://jitpack.io" }    // used for MPAndroidChart
    }
}

android/settings.gradle

include ':reactNativeMPAndroidChart'
project(':reactNativeMPAndroidChart').projectDir = new File(
  rootProject.projectDir,
  '../node_modules/react-native-mp-android-chart/android'
)

android/app/build.gradle

dependencies {
    ...
    compile project(':reactNativeMPAndroidChart')
}

MainApplication.java

On top where imports are:

import com.github.reactNativeMPAndroidChart.MPAndroidChartPackage;

Add package in getPackages method:

protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new MPAndroidChartPackage()             // <----- Add this
    );
}

Usage

There are 8 supported charts with many configuration options. Almost all configuration available in base MPAndroidChart library are available through this wrapper. More details on available configuration can be found on their wiki.

Example of how charts are used and how to apply configuration can be found in example Android application.

Supported charts with examples:

Example code

This is simple example of how BarChart is used.

import {BarChart} from 'react-native-mp-android-chart';

class BarChartScreen extends React.Component {

  constructor() {
    super();

    this.state = {
      data: {
        datasets: [{
          yValues: [100, 105, 102, 110],
          label: 'Data set 1',
          config: {
            color: 'teal'
          }
        }, {
          yValues: [110, 100, 105, 108],
          label: 'Data set 2',
          config: {
            color: 'orange'
          }
        }],
        xValues: ['Q1', 'Q2', 'Q3', 'Q4']
      }
    };
  }

  render() {
    return (
      <View>
        <BarChart
          style={styles.chart}
          data={this.state.data}
          animation={{durationX: 2000}}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  chart: {
    height: 300,
    width: 300
  }
});

Example application

Example Android application with source code and apk is available here.

License

The MIT License

Copyright (c) 2016 Martin Skec

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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].