├── sample ├── chart1.JPG ├── chart2.JPG ├── TitleBar.js ├── Button.js ├── RadarChart.js ├── CombinedChart.js ├── Index.js ├── LineChart.js ├── BarChart.js └── CandleChart.js ├── android ├── libs │ └── mpandroidchartlibrary-2-2-4.jar ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── attrs_chart_view.xml │ │ │ │ └── styles.xml │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── layout │ │ │ │ ├── content_main.xml │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── cn │ │ │ │ └── mandata │ │ │ │ └── react_native_mpchart │ │ │ │ ├── CustomYAxisValueFormatter.java │ │ │ │ ├── PrintfValueFormatter.java │ │ │ │ ├── MPHorizontalBarChartManager.java │ │ │ │ ├── ChartViewManager.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MPChartPackage.java │ │ │ │ ├── MPChartEventListener.java │ │ │ │ ├── MPChartSelectionEventListener.java │ │ │ │ ├── MPPieChartSelectionEventListener.java │ │ │ │ ├── MPCandleStickChartManager.java │ │ │ │ ├── MPPieRadarChartManager.java │ │ │ │ ├── MPBarChartManager.java │ │ │ │ ├── MPPieChartManager.java │ │ │ │ ├── MPRadarChartManager.java │ │ │ │ ├── ChartView.java │ │ │ │ ├── MPLineChartManager.java │ │ │ │ ├── MPCombinedChartManager.java │ │ │ │ └── MPBarLineChartManager.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── cn │ │ │ └── mandata │ │ │ └── react_native_mpchart │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── cn │ │ └── mandata │ │ └── react_native_mpchart │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── index.js ├── HorizontalBarChart.js ├── .gitignore ├── .npmignore ├── package.json ├── RadarChart.js ├── PieChart.js ├── LineChart.js ├── BarChart.js ├── CandleStickChart.js ├── CombinedChart.js └── README.md /sample/chart1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/sample/chart1.JPG -------------------------------------------------------------------------------- /sample/chart2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/sample/chart2.JPG -------------------------------------------------------------------------------- /android/libs/mpandroidchartlibrary-2-2-4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/android/libs/mpandroidchartlibrary-2-2-4.jar -------------------------------------------------------------------------------- /android/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/android/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/android/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/android/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/android/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongyin163/react-native-chart-android/HEAD/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | react-native-mpchart 3 | Settings 4 | MainActivity 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /android/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /android/src/main/res/values/attrs_chart_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | > 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /android/src/test/java/cn/mandata/react_native_mpchart/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package cn.mandata.react_native_mpchart; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /android/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /android/src/androidTest/java/cn/mandata/react_native_mpchart/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package cn.mandata.react_native_mpchart; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import BarChart from './BarChart'; 2 | import HorizontalBarChart from './HorizontalBarChart'; 3 | import LineChart from './LineChart'; 4 | import CandleStickChart from './CandleStickChart'; 5 | import CombinedChart from './CombinedChart'; 6 | import PieChart from './PieChart'; 7 | import RadarChart from './RadarChart'; 8 | 9 | export { 10 | BarChart, 11 | HorizontalBarChart, 12 | LineChart, 13 | CandleStickChart, 14 | CombinedChart, 15 | PieChart, 16 | RadarChart 17 | } 18 | -------------------------------------------------------------------------------- /HorizontalBarChart.js: -------------------------------------------------------------------------------- 1 | import React, {Component, PropTypes} from 'react'; 2 | import {requireNativeComponent, View} from 'react-native'; 3 | import BarChart from './BarChart'; 4 | 5 | class HorizontalBarChart extends BarChart { 6 | render() { 7 | return ( 8 | 9 | ); 10 | } 11 | } 12 | 13 | var MPHorizontalBarChart = requireNativeComponent('MPHorizontalBarChart', HorizontalBarChart); 14 | 15 | export default HorizontalBarChart; 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | *.iml 36 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | /android/src/test 27 | /android/src/androidTest 28 | # 29 | .idea 30 | .gradle 31 | local.properties 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | sample/ 37 | npm-debug.log 38 | -------------------------------------------------------------------------------- /android/src/main/java/cn/mandata/react_native_mpchart/CustomYAxisValueFormatter.java: -------------------------------------------------------------------------------- 1 | package cn.mandata.react_native_mpchart; 2 | 3 | import com.github.mikephil.charting.components.YAxis; 4 | import com.github.mikephil.charting.formatter.YAxisValueFormatter; 5 | 6 | /** 7 | * Created by Administrator on 2015/11/7. 8 | */ 9 | public class CustomYAxisValueFormatter implements YAxisValueFormatter { 10 | private String FormAt=""; 11 | public CustomYAxisValueFormatter(String formAt){ 12 | this.FormAt=formAt; 13 | } 14 | @Override 15 | public String getFormattedValue(float v, YAxis yAxis) { 16 | return String.format(FormAt,v); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/src/main/java/cn/mandata/react_native_mpchart/PrintfValueFormatter.java: -------------------------------------------------------------------------------- 1 | package cn.mandata.react_native_mpchart; 2 | 3 | import com.github.mikephil.charting.data.Entry; 4 | import com.github.mikephil.charting.formatter.ValueFormatter; 5 | import com.github.mikephil.charting.utils.ViewPortHandler; 6 | 7 | import android.util.Log; 8 | 9 | public class PrintfValueFormatter implements ValueFormatter { 10 | 11 | private String format = ""; 12 | 13 | public PrintfValueFormatter(String format){ 14 | if(format != null) this.format = format; 15 | } 16 | 17 | @Override 18 | public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) { 19 | return String.format(format, value); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\WorkFolder\MyProject\Tool\adt-bundle-windows-x86\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:1.3.1' 10 | } 11 | } 12 | android { 13 | compileSdkVersion 23 14 | buildToolsVersion "23.0.1" 15 | 16 | defaultConfig { 17 | minSdkVersion 16 18 | targetSdkVersion 23 19 | versionCode 1 20 | versionName "1.0" 21 | } 22 | lintOptions { 23 | abortOnError false 24 | } 25 | } 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | compile 'com.android.support:design:23.0.1' 29 | compile 'com.facebook.react:react-native:0.20.+' 30 | compile 'com.android.support:appcompat-v7:23.0.1' 31 | } 32 | -------------------------------------------------------------------------------- /android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |