├── .gitignore
├── .npmignore
├── BarChart.js
├── CandleStickChart.js
├── CombinedChart.js
├── HorizontalBarChart.js
├── LineChart.js
├── PieChart.js
├── README.md
├── RadarChart.js
├── android
├── build.gradle
├── libs
│ └── mpandroidchartlibrary-2-2-4.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── cn
│ │ └── mandata
│ │ └── react_native_mpchart
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── cn
│ │ │ └── mandata
│ │ │ └── react_native_mpchart
│ │ │ ├── ChartView.java
│ │ │ ├── ChartViewManager.java
│ │ │ ├── CustomYAxisValueFormatter.java
│ │ │ ├── MPBarChartManager.java
│ │ │ ├── MPBarLineChartManager.java
│ │ │ ├── MPCandleStickChartManager.java
│ │ │ ├── MPChartEventListener.java
│ │ │ ├── MPChartPackage.java
│ │ │ ├── MPChartSelectionEventListener.java
│ │ │ ├── MPCombinedChartManager.java
│ │ │ ├── MPHorizontalBarChartManager.java
│ │ │ ├── MPLineChartManager.java
│ │ │ ├── MPPieChartManager.java
│ │ │ ├── MPPieChartSelectionEventListener.java
│ │ │ ├── MPPieRadarChartManager.java
│ │ │ ├── MPRadarChartManager.java
│ │ │ ├── MainActivity.java
│ │ │ └── PrintfValueFormatter.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── content_main.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── 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-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── attrs_chart_view.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── cn
│ └── mandata
│ └── react_native_mpchart
│ └── ExampleUnitTest.java
├── index.js
├── package.json
└── sample
├── BarChart.js
├── Button.js
├── CandleChart.js
├── CombinedChart.js
├── Index.js
├── LineChart.js
├── RadarChart.js
├── TitleBar.js
├── chart1.JPG
└── chart2.JPG
/.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 |
--------------------------------------------------------------------------------
/BarChart.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import PropTypes from 'prop-types';
3 | import {requireNativeComponent, View} from 'react-native';
4 |
5 | class BarChart extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return (
12 |
13 | );
14 | }
15 | }
16 |
17 | BarChart.propTypes = {
18 | ...View.propTypes,
19 | data:PropTypes.object,
20 | touchEnabled:PropTypes.bool,
21 | dragEnabled:PropTypes.bool,
22 | scaleEnabled:PropTypes.bool,
23 | scaleXEnabled:PropTypes.bool,
24 | scaleYEnabled:PropTypes.bool,
25 | pinchZoom:PropTypes.bool,
26 | doubleTapToZoomEnabled:PropTypes.bool,
27 | highlightPerDragEnabled:PropTypes.bool,
28 | highlightPerTapEnabled:PropTypes.bool,
29 | dragDecelerationEnabled:PropTypes.bool,
30 | dragDecelerationFrictionCoef:PropTypes.number,
31 | maxVisibleValueCount:PropTypes.number,
32 | limitLine:PropTypes.object,
33 | description:PropTypes.string,
34 | backgroundColor:PropTypes.string,
35 | drawGridBackground:PropTypes.bool,
36 | gridBackgroundColor:PropTypes.string,
37 | visibleXRange:PropTypes.array,
38 | borderColor:PropTypes.string,
39 | borderWidth:PropTypes.number,
40 | xAxis:PropTypes.object,
41 | yAxisLeft:PropTypes.object,
42 | yAxisRight:PropTypes.object,
43 | yAxis:PropTypes.object,
44 | fitScreen:PropTypes.bool,
45 | chartPadding:PropTypes.string,
46 | legend:PropTypes.object,
47 | scaleX: PropTypes.number,
48 | scaleY: PropTypes.number,
49 | translateX: PropTypes.number,
50 | translateY: PropTypes.number,
51 | rotation: PropTypes.number,
52 | renderToHardwareTextureAndroid: PropTypes.bool,
53 | onLayout: PropTypes.bool,
54 | accessibilityLiveRegion: PropTypes.string,
55 | accessibilityComponentType: PropTypes.string,
56 | importantForAccessibility: PropTypes.string,
57 | accessibilityLabel: PropTypes.string,
58 | testID: PropTypes.string,
59 | viewCenter: PropTypes.array,
60 | zoomTo: PropTypes.object,
61 | extraOffsets: PropTypes.string
62 | }
63 |
64 | var MPBarChart = requireNativeComponent('MPBarChart', BarChart);
65 |
66 | export default BarChart;
67 |
--------------------------------------------------------------------------------
/CandleStickChart.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import PropTypes from 'prop-types';
3 | import {requireNativeComponent, View} from 'react-native';
4 |
5 | class CandleStickChart extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return (
12 |
13 | );
14 | }
15 | }
16 |
17 | CandleStickChart.propTypes = {
18 | ...View.propTypes,
19 | data:PropTypes.object,
20 | touchEnabled:PropTypes.bool,
21 | dragEnabled:PropTypes.bool,
22 | scaleEnabled:PropTypes.bool,
23 | scaleXEnabled:PropTypes.bool,
24 | scaleYEnabled:PropTypes.bool,
25 | pinchZoom:PropTypes.bool,
26 | doubleTapToZoomEnabled:PropTypes.bool,
27 | highlightPerDragEnabled:PropTypes.bool,
28 | highlightPerTapEnabled:PropTypes.bool,
29 | dragDecelerationEnabled:PropTypes.bool,
30 | dragDecelerationFrictionCoef:PropTypes.number,
31 | maxVisibleValueCount:PropTypes.number,
32 | limitLine:PropTypes.object,
33 | description:PropTypes.string,
34 | backgroundColor:PropTypes.string,
35 | drawGridBackground:PropTypes.bool,
36 | gridBackgroundColor:PropTypes.string,
37 | visibleXRange:PropTypes.array,
38 | borderColor:PropTypes.string,
39 | borderWidth:PropTypes.number,
40 | xAxis:PropTypes.object,
41 | yAxisLeft:PropTypes.object,
42 | yAxisRight:PropTypes.object,
43 | yAxis:PropTypes.object,
44 | fitScreen:PropTypes.bool,
45 | chartPadding:PropTypes.string,
46 | legend:PropTypes.object,
47 | scaleX: PropTypes.number,
48 | scaleY: PropTypes.number,
49 | translateX: PropTypes.number,
50 | translateY: PropTypes.number,
51 | rotation: PropTypes.number,
52 | renderToHardwareTextureAndroid: PropTypes.bool,
53 | onLayout: PropTypes.bool,
54 | accessibilityLiveRegion: PropTypes.string,
55 | accessibilityComponentType: PropTypes.string,
56 | importantForAccessibility: PropTypes.string,
57 | accessibilityLabel: PropTypes.string,
58 | testID: PropTypes.string,
59 | viewCenter: PropTypes.array,
60 | zoomTo: PropTypes.object,
61 | extraOffsets: PropTypes.string
62 | }
63 |
64 | var MPCandleStickChart = requireNativeComponent('MPCandleStickChart', CandleStickChart);
65 |
66 | export default CandleStickChart;
67 |
--------------------------------------------------------------------------------
/CombinedChart.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import PropTypes from 'prop-types';
3 | import { requireNativeComponent, View } from 'react-native';
4 |
5 | class CombinedChart extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | let chartData = {};
12 | let children = this.props.children;
13 | let { style, animateY, animateX, animateXY, ...other } = this.props;
14 |
15 | if (children.length) {
16 | for (var i = 0; i < children.length; i++) {
17 | var child = children[i]
18 | chartData[child.props.chartType] = child.props.data;
19 | }
20 | } else {
21 | chartData[children.props.chartType] = children.props.data;
22 | }
23 |
24 | if (animateY) {
25 | chartData.animateY = animateY
26 | } else if (animateX) {
27 | chartData.animateX = animateX
28 | } else if (animateXY) {
29 | chartData.animateXY = animateXY
30 | }
31 |
32 | return (
33 |
38 | );
39 | }
40 | }
41 |
42 | CombinedChart.propTypes = {
43 | ...View.propTypes,
44 | data: PropTypes.object,
45 | touchEnabled: PropTypes.bool,
46 | dragEnabled: PropTypes.bool,
47 | scaleEnabled: PropTypes.bool,
48 | scaleXEnabled: PropTypes.bool,
49 | scaleYEnabled: PropTypes.bool,
50 | pinchZoom: PropTypes.bool,
51 | doubleTapToZoomEnabled: PropTypes.bool,
52 | highlightPerDragEnabled: PropTypes.bool,
53 | highlightPerTapEnabled: PropTypes.bool,
54 | dragDecelerationEnabled: PropTypes.bool,
55 | dragDecelerationFrictionCoef: PropTypes.number,
56 | maxVisibleValueCount: PropTypes.number,
57 | limitLine: PropTypes.object,
58 | description: PropTypes.string,
59 | backgroundColor: PropTypes.string,
60 | drawGridBackground: PropTypes.bool,
61 | gridBackgroundColor: PropTypes.string,
62 | visibleXRange: PropTypes.array,
63 | borderColor: PropTypes.string,
64 | borderWidth: PropTypes.number,
65 | xAxis: PropTypes.object,
66 | yAxisLeft: PropTypes.object,
67 | yAxisRight: PropTypes.object,
68 | yAxis: PropTypes.object,
69 | fitScreen: PropTypes.bool,
70 | chartPadding: PropTypes.string,
71 | legend: PropTypes.object,
72 | scaleX: PropTypes.number,
73 | scaleY: PropTypes.number,
74 | translateX: PropTypes.number,
75 | translateY: PropTypes.number,
76 | rotation: PropTypes.number,
77 | renderToHardwareTextureAndroid: PropTypes.bool,
78 | onLayout: PropTypes.bool,
79 | accessibilityLiveRegion: PropTypes.string,
80 | accessibilityComponentType: PropTypes.string,
81 | importantForAccessibility: PropTypes.string,
82 | accessibilityLabel: PropTypes.string,
83 | testID: PropTypes.string,
84 | viewCenter: PropTypes.array,
85 | zoomTo: PropTypes.object,
86 | extraOffsets: PropTypes.string,
87 | animateY: PropTypes.object,
88 | animateX: PropTypes.object,
89 | animateXY: PropTypes.object,
90 | };
91 |
92 | class chart extends Component {
93 | constructor(props) {
94 | super(props);
95 | }
96 | render() {
97 | return null;
98 | }
99 | }
100 | chart.propTypes = {
101 | chartType: PropTypes.string,
102 | data: PropTypes.object,
103 | };
104 | CombinedChart.Chart = chart;
105 |
106 | // RIGHT_OF_CHART,
107 | // RIGHT_OF_CHART_CENTER,
108 | // RIGHT_OF_CHART_INSIDE,
109 | // LEFT_OF_CHART,
110 | // LEFT_OF_CHART_CENTER,
111 | // LEFT_OF_CHART_INSIDE,
112 | // BELOW_CHART_LEFT,
113 | // BELOW_CHART_RIGHT,
114 | // BELOW_CHART_CENTER,
115 | // ABOVE_CHART_LEFT,
116 | // ABOVE_CHART_RIGHT,
117 | // ABOVE_CHART_CENTER,
118 | // PIECHART_CENTER;
119 |
120 | var MPCombinedChart = requireNativeComponent('MPCombinedChart', CombinedChart);
121 |
122 | export default CombinedChart;
123 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/LineChart.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import PropTypes from 'prop-types';
3 | import {requireNativeComponent, View} from 'react-native';
4 |
5 | class LineChart extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return (
12 |
13 | );
14 | }
15 | }
16 |
17 | LineChart.propTypes = {
18 | ...View.propTypes,
19 | data:PropTypes.object,
20 | touchEnabled:PropTypes.bool,
21 | dragEnabled:PropTypes.bool,
22 | scaleEnabled:PropTypes.bool,
23 | scaleXEnabled:PropTypes.bool,
24 | scaleYEnabled:PropTypes.bool,
25 | pinchZoom:PropTypes.bool,
26 | doubleTapToZoomEnabled:PropTypes.bool,
27 | highlightPerDragEnabled:PropTypes.bool,
28 | highlightPerTapEnabled:PropTypes.bool,
29 | dragDecelerationEnabled:PropTypes.bool,
30 | dragDecelerationFrictionCoef:PropTypes.number,
31 | maxVisibleValueCount:PropTypes.number,
32 | limitLine:PropTypes.object,
33 | description:PropTypes.string,
34 | backgroundColor:PropTypes.string,
35 | drawGridBackground:PropTypes.bool,
36 | gridBackgroundColor:PropTypes.string,
37 | visibleXRange:PropTypes.array,
38 | borderColor:PropTypes.string,
39 | borderWidth:PropTypes.number,
40 | xAxis:PropTypes.object,
41 | yAxisLeft:PropTypes.object,
42 | yAxisRight:PropTypes.object,
43 | yAxis:PropTypes.object,
44 | fitScreen:PropTypes.bool,
45 | chartPadding:PropTypes.string,
46 | legend:PropTypes.object,
47 | viewCenter: PropTypes.array,
48 | zoomTo: PropTypes.object,
49 | extraOffsets: PropTypes.string
50 | }
51 |
52 | var MPLineChart = requireNativeComponent('MPLineChart', LineChart);
53 |
54 | export default LineChart;
55 |
--------------------------------------------------------------------------------
/PieChart.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import PropTypes from 'prop-types';
3 | import {requireNativeComponent, View} from 'react-native';
4 |
5 | class PieChart extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return (
12 |
13 | );
14 | }
15 | }
16 |
17 | PieChart.propTypes = {
18 | ...View.propTypes,
19 | data:PropTypes.object,
20 | touchEnabled:PropTypes.bool,
21 | dragEnabled:PropTypes.bool,
22 | scaleEnabled:PropTypes.bool,
23 | scaleXEnabled:PropTypes.bool,
24 | scaleYEnabled:PropTypes.bool,
25 | pinchZoom:PropTypes.bool,
26 | doubleTapToZoomEnabled:PropTypes.bool,
27 | highlightPerDragEnabled:PropTypes.bool,
28 | highlightPerTapEnabled:PropTypes.bool,
29 | dragDecelerationEnabled:PropTypes.bool,
30 | dragDecelerationFrictionCoef:PropTypes.number,
31 | maxVisibleValueCount:PropTypes.number,
32 | limitLine:PropTypes.object,
33 | description:PropTypes.string,
34 | backgroundColor:PropTypes.string,
35 | drawGridBackground:PropTypes.bool,
36 | gridBackgroundColor:PropTypes.string,
37 | borderColor:PropTypes.string,
38 | borderWidth:PropTypes.number,
39 | chartPadding:PropTypes.string,
40 | legend:PropTypes.object,
41 | holeRadius: PropTypes.number,
42 | transparentCircleRadius: PropTypes.number,
43 | drawSliceText: PropTypes.bool,
44 | usePercentValues: PropTypes.bool,
45 | centerText: PropTypes.string,
46 | centerTextRadiusPercent: PropTypes.number
47 | }
48 |
49 | var MPPieChart = requireNativeComponent('MPPieChart', PieChart);
50 |
51 | export default PieChart;
52 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-chart-android
2 | react-native-chart-android provide modules to add chart to android,all charts are come from mpandroidchart library,include bar chart ,line chart,combine chart etc.
3 |
4 | about MpAndroidChart ,you can read doc:
5 |
6 | -[**MPAndroidChart-github**](https://github.com/PhilJay/MPAndroidChart/)
7 | -[**MPAndroidChart-Wiki**](https://github.com/PhilJay/MPAndroidChart/wiki)
8 |
9 |
10 | ### Installation
11 |
12 | ```
13 | npm install react-native-chart-android --save
14 | ```
15 |
16 | ### Add it to your android project
17 |
18 | * In `android/setting.gradle`
19 |
20 | ```gradle
21 | include ':react-native-chart-android'
22 | project(':react-native-chart-android').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-chart-android/android')
23 | ```
24 |
25 | * In `android/app/build.gradle`
26 |
27 | ```gradle
28 | ...
29 | dependencies {
30 | ...
31 | compile project(':react-native-chart-android')
32 | }
33 | ```
34 |
35 | * Register Module (in MainApplication.java)
36 |
37 | ```java
38 | import cn.mandata.react_native_mpchart.MPChartPackage; // <--- import
39 |
40 | public class MainActivity extends ReactActivity {
41 |
42 | ......
43 |
44 | /**
45 | * A list of packages used by the app. If the app uses additional views
46 | * or modules besides the default ones, add more packages here.
47 | */
48 | @Override
49 | protected List getPackages() {
50 | return Arrays.asList(
51 | new MainReactPackage(),
52 | new ReactNativeIcons(Arrays.asList(
53 | new IconFont("typicons", "typicons.ttf"),
54 | new IconFont("fontawesome", "FontAwesome.otf")
55 | )),
56 | new MPChartPackage(),// <------ add this line to yout MainActivity class
57 | new ManDataLibPackage(),
58 | new BaiduVoiseLibPackage()
59 | );
60 | }
61 | ......
62 | }
63 | ```
64 |
65 | ## Example
66 | ```javascript
67 | /* @flow */
68 | 'use strict';
69 |
70 | var React = require('react-native');
71 | var TitleBar=require('./TitleBar');
72 | var {
73 | BarChart,
74 | CombinedChart
75 | }=require('../index.android');
76 | var {
77 | StyleSheet,
78 | View,
79 | Text
80 | } = React;
81 |
82 | var Component = React.createClass({
83 | getBarData:function (argument) {
84 | var data={
85 | xValues:['1','2','3'],
86 | yValues:[
87 | {
88 | data:[4.0,5.0,6.0],
89 | label:'test1',
90 | config:{
91 | color:'blue'
92 | }
93 | },
94 | {
95 | data:[4.0,5.0,6.0],
96 | label:'test2',
97 | config:{
98 | color:'red'
99 | }
100 | },
101 | {
102 | data:[4.0,5.0,6.0],
103 | label:'test2',
104 | config:{
105 | color:'yellow'
106 | }
107 | }
108 | ]
109 | };
110 | return data;
111 | },
112 | getRandomData:function (argument) {
113 | var data={};
114 | data['xValues']=[];
115 | data['yValues']=[
116 | {
117 | data:[],
118 | label:'test1',
119 | config:{
120 | color:'blue'
121 | }
122 | }
123 | ];
124 | for (var i = 0; i < 500; i++) {
125 | data.xValues.push(i+'');
126 | data.yValues[0].data.push(Math.random()*100);
127 | };
128 | return data;
129 | },
130 | render: function() {
131 | return (
132 |
133 |
134 |
135 |
136 |
137 |
150 |
151 | {
178 | console.log("onSelect xIndex", e.nativeEvent.xIndex, "yValue:", e.nativeEvent.yValue);
179 | }}
180 | />
181 |
182 |
183 | );
184 | }
185 | });
186 |
187 | var styles = StyleSheet.create({
188 | container:{
189 | flex:1
190 | },
191 | chartContainer:{
192 | flex:1
193 | },
194 | chart:{
195 | flex:1
196 | }
197 | });
198 |
199 |
200 | module.exports = Component;
201 |
202 | ```
203 | 
204 |
205 | 
206 |
207 | There are some samples in sample folder,you can download them and try to run them.
208 | ## License
209 | MIT
210 |
--------------------------------------------------------------------------------
/RadarChart.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import PropTypes from 'prop-types';
3 | import {requireNativeComponent, View} from 'react-native';
4 |
5 | class RadarChart extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return (
12 |
13 | );
14 | }
15 | }
16 |
17 | RadarChart.propTypes = {
18 | ...View.propTypes,
19 | data:PropTypes.object,
20 | webLineWidth:PropTypes.number,
21 | webLineWidthInner:PropTypes.number,
22 | webAlpha:PropTypes.number,
23 | webColor:PropTypes.number,
24 | webColorInner:PropTypes.number,
25 | drawWeb:PropTypes.bool,
26 | dragEnabled:PropTypes.bool,
27 | legend:PropTypes.object,
28 | touchEnabled:PropTypes.bool,
29 | dragDecelerationEnabled:PropTypes.bool,
30 | dragDecelerationFrictionCoef:PropTypes.number,
31 | description:PropTypes.string,
32 | chartPadding:PropTypes.string,
33 | highlightPerDragEnabled:PropTypes.bool,
34 | highlightPerTapEnabled:PropTypes.bool,
35 | skipWebLineCount:PropTypes.number,
36 | }
37 |
38 | var MPRadarChart = requireNativeComponent('MPRadarChart', RadarChart);
39 |
40 | export default RadarChart;
41 |
--------------------------------------------------------------------------------
/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/libs/mpandroidchartlibrary-2-2-4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hongyin163/react-native-chart-android/eeba3aced601eafe34bad33f784ea55bf81f0fa6/android/libs/mpandroidchartlibrary-2-2-4.jar
--------------------------------------------------------------------------------
/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/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 | }
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/ChartView.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Canvas;
6 | import android.graphics.Color;
7 | import android.graphics.Paint;
8 | import android.graphics.drawable.Drawable;
9 | import android.text.TextPaint;
10 | import android.util.AttributeSet;
11 | import android.view.View;
12 |
13 | /**
14 | * TODO: document your custom view class.
15 | */
16 | public class ChartView extends View {
17 | private String mExampleString; // TODO: use a default from R.string...
18 | private int mExampleColor = Color.RED; // TODO: use a default from R.color...
19 | private float mExampleDimension = 0; // TODO: use a default from R.dimen...
20 | private Drawable mExampleDrawable;
21 |
22 | private TextPaint mTextPaint;
23 | private float mTextWidth;
24 | private float mTextHeight;
25 |
26 | public ChartView(Context context) {
27 | super(context);
28 | init(null, 0);
29 | }
30 |
31 | public ChartView(Context context, AttributeSet attrs) {
32 | super(context, attrs);
33 | init(attrs, 0);
34 | }
35 |
36 | public ChartView(Context context, AttributeSet attrs, int defStyle) {
37 | super(context, attrs, defStyle);
38 | init(attrs, defStyle);
39 | }
40 |
41 |
42 | private void init(AttributeSet attrs, int defStyle) {
43 | // Load attributes
44 | final TypedArray a = getContext().obtainStyledAttributes(
45 | attrs, R.styleable.ChartView, defStyle, 0);
46 |
47 | mExampleString = a.getString(
48 | R.styleable.ChartView_exampleString);
49 | mExampleColor = a.getColor(
50 | R.styleable.ChartView_exampleColor,
51 | mExampleColor);
52 | // Use getDimensionPixelSize or getDimensionPixelOffset when dealing with
53 | // values that should fall on pixel boundaries.
54 | mExampleDimension = a.getDimension(
55 | R.styleable.ChartView_exampleDimension,
56 | mExampleDimension);
57 |
58 | if (a.hasValue(R.styleable.ChartView_exampleDrawable)) {
59 | mExampleDrawable = a.getDrawable(
60 | R.styleable.ChartView_exampleDrawable);
61 | mExampleDrawable.setCallback(this);
62 | }
63 |
64 | a.recycle();
65 |
66 | // Set up a default TextPaint object
67 | mTextPaint = new TextPaint();
68 | mTextPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
69 | mTextPaint.setTextAlign(Paint.Align.LEFT);
70 |
71 | // Update TextPaint and text measurements from attributes
72 | invalidateTextPaintAndMeasurements();
73 | }
74 |
75 | private void invalidateTextPaintAndMeasurements() {
76 | mTextPaint.setTextSize(mExampleDimension);
77 | mTextPaint.setColor(mExampleColor);
78 | if(mExampleString==null)
79 | mExampleString="";
80 | mTextWidth = mTextPaint.measureText(mExampleString);
81 |
82 | Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics();
83 | mTextHeight = fontMetrics.bottom;
84 | }
85 |
86 | @Override
87 | protected void onDraw(Canvas canvas) {
88 | super.onDraw(canvas);
89 |
90 | // TODO: consider storing these as member variables to reduce
91 | // allocations per draw cycle.
92 | int paddingLeft = getPaddingLeft();
93 | int paddingTop = getPaddingTop();
94 | int paddingRight = getPaddingRight();
95 | int paddingBottom = getPaddingBottom();
96 |
97 | int contentWidth = getWidth() - paddingLeft - paddingRight;
98 | int contentHeight = getHeight() - paddingTop - paddingBottom;
99 |
100 | // Draw the text.
101 | canvas.drawText(mExampleString,
102 | paddingLeft + (contentWidth - mTextWidth) / 2,
103 | paddingTop + (contentHeight + mTextHeight) / 2,
104 | mTextPaint);
105 |
106 | // Draw the example drawable on top of the text.
107 | if (mExampleDrawable != null) {
108 | mExampleDrawable.setBounds(paddingLeft, paddingTop,
109 | paddingLeft + contentWidth, paddingTop + contentHeight);
110 | mExampleDrawable.draw(canvas);
111 | }
112 | }
113 |
114 |
115 | public void setData(String data){
116 | this.setExampleString(data);
117 | }
118 | /**
119 | * Gets the example string attribute value.
120 | *
121 | * @return The example string attribute value.
122 | */
123 | public String getExampleString() {
124 | return mExampleString;
125 | }
126 |
127 | /**
128 | * Sets the view's example string attribute value. In the example view, this string
129 | * is the text to draw.
130 | *
131 | * @param exampleString The example string attribute value to use.
132 | */
133 | public void setExampleString(String exampleString) {
134 | mExampleString = exampleString;
135 | invalidateTextPaintAndMeasurements();
136 | }
137 |
138 | /**
139 | * Gets the example color attribute value.
140 | *
141 | * @return The example color attribute value.
142 | */
143 | public int getExampleColor() {
144 | return mExampleColor;
145 | }
146 |
147 | /**
148 | * Sets the view's example color attribute value. In the example view, this color
149 | * is the font color.
150 | *
151 | * @param exampleColor The example color attribute value to use.
152 | */
153 | public void setExampleColor(int exampleColor) {
154 | mExampleColor = exampleColor;
155 | invalidateTextPaintAndMeasurements();
156 | }
157 |
158 | /**
159 | * Gets the example dimension attribute value.
160 | *
161 | * @return The example dimension attribute value.
162 | */
163 | public float getExampleDimension() {
164 | return mExampleDimension;
165 | }
166 |
167 | /**
168 | * Sets the view's example dimension attribute value. In the example view, this dimension
169 | * is the font size.
170 | *
171 | * @param exampleDimension The example dimension attribute value to use.
172 | */
173 | public void setExampleDimension(float exampleDimension) {
174 | mExampleDimension = exampleDimension;
175 | invalidateTextPaintAndMeasurements();
176 | }
177 |
178 | /**
179 | * Gets the example drawable attribute value.
180 | *
181 | * @return The example drawable attribute value.
182 | */
183 | public Drawable getExampleDrawable() {
184 | return mExampleDrawable;
185 | }
186 |
187 | /**
188 | * Sets the view's example drawable attribute value. In the example view, this drawable is
189 | * drawn above the text.
190 | *
191 | * @param exampleDrawable The example drawable attribute value to use.
192 | */
193 | public void setExampleDrawable(Drawable exampleDrawable) {
194 | mExampleDrawable = exampleDrawable;
195 | }
196 | }
197 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/ChartViewManager.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.support.annotation.Nullable;
4 |
5 | import com.facebook.react.uimanager.annotations.ReactProp;
6 | import com.facebook.react.uimanager.SimpleViewManager;
7 | import com.facebook.react.uimanager.ThemedReactContext;
8 |
9 | /**
10 | * Created by Administrator on 2015/11/6.
11 | */
12 | public class ChartViewManager extends SimpleViewManager {
13 | public static final String REACT_CLASS = "MPChart";
14 | @Override
15 | public String getName() {
16 | return REACT_CLASS;
17 | }
18 |
19 | @Override
20 | protected ChartView createViewInstance(ThemedReactContext reactContext) {
21 | ChartView chart= new ChartView(reactContext);
22 | chart.setExampleDimension(50);
23 | return chart;
24 | }
25 |
26 | @ReactProp(name = "data")
27 | public void setData(ChartView view, @Nullable String text) {
28 | view.setData(text);
29 | view.invalidate();
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/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/java/cn/mandata/react_native_mpchart/MPBarChartManager.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.graphics.Color;
4 |
5 | import com.facebook.react.bridge.ReadableArray;
6 | import com.facebook.react.bridge.ReadableMap;
7 | import com.facebook.react.uimanager.annotations.ReactProp;
8 | import com.facebook.react.uimanager.SimpleViewManager;
9 | import com.facebook.react.uimanager.ThemedReactContext;
10 | import com.github.mikephil.charting.charts.BarChart;
11 | import com.github.mikephil.charting.charts.BarLineChartBase;
12 | import com.github.mikephil.charting.components.AxisBase;
13 | import com.github.mikephil.charting.components.LimitLine;
14 | import com.github.mikephil.charting.components.YAxis;
15 | import com.github.mikephil.charting.data.BarData;
16 | import com.github.mikephil.charting.data.BarDataSet;
17 | import com.github.mikephil.charting.data.BarEntry;
18 | import com.github.mikephil.charting.data.DataSet;
19 | import com.github.mikephil.charting.utils.ColorTemplate;
20 |
21 | import java.util.ArrayList;
22 | import java.util.Random;
23 |
24 | /**
25 | * Created by Administrator on 2015/11/6.
26 | */
27 | public class MPBarChartManager extends MPBarLineChartManager {
28 | private String CLASS_NAME="MPBarChart";
29 | @Override
30 | public String getName() {
31 | return this.CLASS_NAME;
32 | }
33 |
34 | @Override
35 | protected BarChart createViewInstance(ThemedReactContext reactContext) {
36 | BarChart chart=new BarChart(reactContext);
37 |
38 | // initialise event listener to bind to chart
39 | new MPChartSelectionEventListener(chart);
40 |
41 | return chart;
42 | }
43 |
44 | //{XValues:[],YValues:[{Data:[],Label:""},{}]}
45 | @ReactProp(name="data")
46 | public void setData(BarChart chart,ReadableMap rm){
47 |
48 | ReadableArray xArray=rm.getArray("xValues");
49 | ArrayList xVals=new ArrayList();
50 | for(int m=0;m entries=new ArrayList();
61 | for (int j=0;j colors = new ArrayList<>();
74 | for(int c = 0; c < colorsArray.size(); c++){
75 | colors.add(Color.parseColor(colorsArray.getString(c)));
76 | }
77 | dataSet.setValueTextColors(colors);
78 | }else
79 | if(config.hasKey("valueTextColor")) dataSet.setValueTextColor(Color.parseColor(config.getString("valueTextColor")));
80 |
81 | // Text Size for bar value
82 |
83 | if(config.hasKey("valueTextSize")) dataSet.setValueTextSize((float)config.getDouble("valueTextSize"));
84 |
85 | if(config.hasKey("drawValues")) dataSet.setDrawValues(config.getBoolean("drawValues"));
86 | if(config.hasKey("colors")){
87 | ReadableArray colorsArray = config.getArray("colors");
88 | ArrayList colors = new ArrayList<>();
89 | for(int c = 0; c < colorsArray.size(); c++){
90 | colors.add(Color.parseColor(colorsArray.getString(c)));
91 | }
92 | dataSet.setColors(colors);
93 | }else
94 | if(config.hasKey("color")) {
95 | int[] colors=new int[]{Color.parseColor(config.getString("color"))};
96 | dataSet.setColors(colors);
97 | }
98 |
99 | if(config.hasKey("valueFormatter")){
100 | ReadableMap formatterMap = config.getMap("valueFormatter");
101 | if(formatterMap.hasKey("type")){
102 | String type = formatterMap.getString("type");
103 | if("printf".equalsIgnoreCase(type)){
104 | String format = "";
105 | if(formatterMap.hasKey("format")) format = formatterMap.getString("format");
106 | dataSet.setValueFormatter(new PrintfValueFormatter(format));
107 | }
108 | }
109 | }
110 |
111 | barData.addDataSet(dataSet);
112 |
113 | }
114 | chart.setData(barData);
115 |
116 | /**
117 | * Graph animation configurations
118 | * If no animation config provided, call chart.invalidate()
119 | * animation configs are maps with the following keys
120 | * - duration or durationX/durationY in case of animateXY
121 | * - support for easeFunction yet to be given
122 | */
123 | if (rm.hasKey("animateX")) {
124 | chart.animateX(rm.getMap("animateX").getInt("duration"));
125 | } else if (rm.hasKey("animateY")) {
126 | chart.animateY(rm.getMap("animateY").getInt("duration"));
127 | } else if (rm.hasKey("animateXY")) {
128 | ReadableMap animationConfig = rm.getMap("animateXY");
129 | chart.animateXY(
130 | animationConfig.getInt("durationX"),
131 | animationConfig.getInt("durationY")
132 | );
133 | } else {
134 | chart.invalidate();
135 | }
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MPBarLineChartManager.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.graphics.Color;
4 |
5 | import com.facebook.react.bridge.ReadableArray;
6 | import com.facebook.react.bridge.ReadableMap;
7 | import com.facebook.react.uimanager.annotations.ReactProp;
8 | import com.facebook.react.uimanager.SimpleViewManager;
9 | import com.facebook.react.uimanager.ThemedReactContext;
10 | import com.github.mikephil.charting.charts.BarChart;
11 | import com.github.mikephil.charting.charts.BarLineChartBase;
12 | import com.github.mikephil.charting.components.AxisBase;
13 | import com.github.mikephil.charting.components.Legend;
14 | import com.github.mikephil.charting.components.LimitLine;
15 | import com.github.mikephil.charting.components.XAxis;
16 | import com.github.mikephil.charting.components.YAxis;
17 | import com.github.mikephil.charting.components.YAxis.AxisDependency;
18 | import com.github.mikephil.charting.data.BarData;
19 | import com.github.mikephil.charting.data.BarDataSet;
20 | import com.github.mikephil.charting.data.BarEntry;
21 | import com.github.mikephil.charting.data.DataSet;
22 | import com.github.mikephil.charting.formatter.XAxisValueFormatter;
23 | import com.github.mikephil.charting.utils.ColorTemplate;
24 | import com.github.mikephil.charting.utils.ViewPortHandler;
25 |
26 | import java.util.ArrayList;
27 | import java.util.Random;
28 |
29 | /**
30 | * Created by Administrator on 2015/11/6.
31 | */
32 | public class MPBarLineChartManager extends SimpleViewManager {
33 | private String CLASS_NAME="MPBarLineChart";
34 | private Random random;//用于产生随机数
35 |
36 | private BarChart chart;
37 | private BarData data;
38 | private BarDataSet dataSet;
39 |
40 | @Override
41 | public String getName() {
42 | return this.CLASS_NAME;
43 | }
44 |
45 | @Override
46 | protected BarLineChartBase createViewInstance(ThemedReactContext reactContext) {
47 | BarChart chart=new BarChart(reactContext);
48 | //com.facebook.react.uimanager.ViewGroupManager
49 | /* *//**图表具体设置*//*
50 | ArrayList entries = new ArrayList<>();//显示条目
51 | ArrayList xVals = new ArrayList();//横坐标标签
52 | random=new Random();//随机数
53 | for(int i=0;i<12;i++){
54 | float profit= random.nextFloat()*1000;
55 | //entries.add(BarEntry(float val,int positon);
56 | entries.add(new BarEntry(profit,i));
57 | xVals.add((i+1)+"月");
58 | }
59 | dataSet = new BarDataSet(entries, "公司年利润报表");
60 | dataSet.setColors(ColorTemplate.COLORFUL_COLORS);
61 | data = new BarData(xVals, dataSet);
62 | chart.setData(data);
63 | //设置Y方向上动画animateY(int time);
64 | chart.animateY(3000);
65 | //图表描述
66 | chart.setDescription("公司前半年财务报表(单位:万元)");*/
67 | new MPChartSelectionEventListener(chart);
68 |
69 |
70 | return chart;
71 | }
72 |
73 |
74 | /* //{xLabel:"",yLabel:"",xUnit:"",yUnit:"",xValues:[],yValues:[],unit:"",data:[]}
75 | @ReactProp(name = "config")
76 | public void setConfig(BarChart chart,ReadableMap data){
77 | ReadableArray ra=data.getArray("data");
78 | String label=data.getString("label");
79 |
80 | ArrayList entries = new ArrayList<>();
81 | for(int i=0;i xVals=new ArrayList();
71 | for(int m=0;m entries=new ArrayList();
76 | for(int i=0;i createNativeModules(ReactApplicationContext reactContext) {
21 | return new ArrayList();
22 | }
23 |
24 | @Override
25 | public List> createJSModules() {
26 | return Collections.emptyList();
27 | }
28 |
29 | @Override
30 | public List createViewManagers(ReactApplicationContext reactContext) {
31 | return Arrays.asList(
32 | new ChartViewManager(),
33 | new MPBarChartManager(),
34 | new MPHorizontalBarChartManager(),
35 | new MPLineChartManager(),
36 | new MPCombinedChartManager(),
37 | new MPCandleStickChartManager(),
38 | new MPPieChartManager(),
39 | new MPRadarChartManager()
40 | );
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MPChartSelectionEventListener.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.view.MotionEvent;
4 |
5 | import com.facebook.react.bridge.Arguments;
6 | import com.facebook.react.bridge.WritableMap;
7 | import com.facebook.react.uimanager.ThemedReactContext;
8 | import com.facebook.react.uimanager.events.RCTEventEmitter;
9 | import com.github.mikephil.charting.charts.Chart;
10 | import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
11 |
12 | import com.github.mikephil.charting.data.Entry;
13 | import com.github.mikephil.charting.highlight.Highlight;
14 |
15 |
16 | /*
17 | * implement OnChartValueSelectedListener interface to bridge selection callback
18 | * events support
19 | * use eventName 'topSelect' mapping to 'onSelect' callback prop in JS
20 | */
21 | public class MPChartSelectionEventListener implements OnChartValueSelectedListener {
22 | private Chart chart=null;
23 | public MPChartSelectionEventListener(){
24 |
25 | }
26 | public MPChartSelectionEventListener(Chart chart){
27 | this.chart=chart;
28 |
29 | // bind selection callback listener to chart
30 | this.chart.setOnChartValueSelectedListener(this);
31 | }
32 |
33 | @Override
34 | public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
35 | WritableMap event = Arguments.createMap();
36 | event.putInt("xIndex", e.getXIndex());
37 | event.putDouble("yValue", e.getVal());
38 |
39 | ThemedReactContext reactContext = (ThemedReactContext)this.chart.getContext();
40 |
41 | reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
42 | this.chart.getId(),
43 | "topSelect",
44 | event
45 | );
46 | }
47 |
48 | @Override
49 | public void onNothingSelected() {
50 | WritableMap event = Arguments.createMap();
51 |
52 | // pass xIndex as -1 for representing no selection
53 | event.putInt("xIndex", -1);
54 |
55 | ThemedReactContext reactContext = (ThemedReactContext)this.chart.getContext();
56 |
57 | reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
58 | this.chart.getId(),
59 | "topSelect",
60 | event
61 | );
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MPCombinedChartManager.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 |
4 | import android.graphics.Color;
5 | import android.graphics.Paint;
6 |
7 | import com.facebook.react.bridge.ReadableArray;
8 | import com.facebook.react.bridge.ReadableMap;
9 | import com.facebook.react.uimanager.annotations.ReactProp;
10 | import com.facebook.react.uimanager.annotations.ReactPropGroup;
11 | import com.facebook.react.uimanager.SimpleViewManager;
12 | import com.facebook.react.uimanager.ThemedReactContext;
13 | import com.facebook.react.uimanager.ViewGroupManager;
14 | import com.github.mikephil.charting.charts.BarChart;
15 | import com.github.mikephil.charting.charts.BarLineChartBase;
16 | import com.github.mikephil.charting.charts.CandleStickChart;
17 | import com.github.mikephil.charting.charts.CombinedChart;
18 | import com.github.mikephil.charting.charts.LineChart;
19 | import com.github.mikephil.charting.components.AxisBase;
20 | import com.github.mikephil.charting.components.Legend;
21 | import com.github.mikephil.charting.components.LimitLine;
22 | import com.github.mikephil.charting.components.XAxis;
23 | import com.github.mikephil.charting.components.YAxis;
24 | import com.github.mikephil.charting.data.BarData;
25 | import com.github.mikephil.charting.data.BarDataSet;
26 | import com.github.mikephil.charting.interfaces.datasets.IBarDataSet;
27 | import com.github.mikephil.charting.data.BarEntry;
28 | import com.github.mikephil.charting.data.BarLineScatterCandleBubbleDataSet;
29 | import com.github.mikephil.charting.data.CandleData;
30 | import com.github.mikephil.charting.data.CandleDataSet;
31 | import com.github.mikephil.charting.data.CandleEntry;
32 | import com.github.mikephil.charting.data.CombinedData;
33 | import com.github.mikephil.charting.data.DataSet;
34 | import com.github.mikephil.charting.data.Entry;
35 | import com.github.mikephil.charting.data.LineData;
36 | import com.github.mikephil.charting.data.LineDataSet;
37 | import com.github.mikephil.charting.utils.ColorTemplate;
38 | import com.github.mikephil.charting.components.YAxis.AxisDependency;
39 |
40 | import java.util.List;
41 | import java.util.ArrayList;
42 | import java.util.Random;
43 |
44 | /**
45 | * Created by Administrator on 2015/11/6.
46 | */
47 | public class MPCombinedChartManager extends MPBarLineChartManager {
48 | private String CLASS_NAME="MPCombinedChart";
49 | @Override
50 | public String getName() {
51 | return this.CLASS_NAME;
52 | }
53 | protected String[] mMonths = new String[] {
54 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"
55 | };
56 | @Override
57 | protected CombinedChart createViewInstance(ThemedReactContext reactContext) {
58 | CombinedChart mChart=new CombinedChart(reactContext);
59 | return mChart;
60 | }
61 | //{xValues:[],yValues:[{data:[],label:"",config:{}},{...}]}
62 | public LineData getLineData(ReadableMap rm){
63 |
64 | ReadableArray xArray=rm.getArray("xValues");
65 | ArrayList xVals=new ArrayList();
66 | for(int m=0;m entries=new ArrayList();
77 | for (int j=0;j colors = new ArrayList<>();
97 | for(int c = 0; c < colorsArray.size(); c++){
98 | colors.add(Color.parseColor(colorsArray.getString(c)));
99 | }
100 | dataSet.setColors(colors);
101 | } else if(config.hasKey("color")) {
102 | int[] colors=new int[]{Color.parseColor(config.getString("color"))};
103 | dataSet.setColors(colors);
104 | }
105 |
106 | if (config.hasKey("axisDependency")) {
107 | AxisDependency axisDependency = AxisDependency.LEFT;
108 | if (config.getString("axisDependency").equalsIgnoreCase("RIGHT")) {
109 | axisDependency = AxisDependency.RIGHT;
110 | }
111 | dataSet.setAxisDependency(axisDependency);
112 | }
113 |
114 | chartData.addDataSet(dataSet);
115 | }
116 | return chartData;
117 | }
118 |
119 | public BarData getBarData(ReadableMap rm){
120 |
121 | ReadableArray xArray=rm.getArray("xValues");
122 | List xVals=new ArrayList();
123 | for(int m=0;m dataSetList=new ArrayList();
128 | for(int i=0;i entries=new ArrayList();
134 | for (int j=0;j colors = new ArrayList<>();
145 | for(int c = 0; c < colorsArray.size(); c++){
146 | colors.add(Color.parseColor(colorsArray.getString(c)));
147 | }
148 | dataSet.setColors(colors);
149 | }else if(config.hasKey("color")) {
150 | int[] colors=new int[]{Color.parseColor(config.getString("color"))};
151 | dataSet.setColors(colors);
152 | }
153 |
154 | if (config.hasKey("axisDependency")) {
155 | AxisDependency axisDependency = AxisDependency.RIGHT;
156 | if (config.getString("axisDependency").equalsIgnoreCase("LEFT")) {
157 | axisDependency = AxisDependency.LEFT;
158 | }
159 | dataSet.setAxisDependency(axisDependency);
160 | }
161 |
162 | dataSetList.add(dataSet);
163 | }
164 | BarData barData=new BarData(xVals,dataSetList);
165 | return barData;
166 | }
167 |
168 | public CandleData getCandleData(ReadableMap rm){
169 | String label=rm.getString("label");
170 | ReadableArray xArray=rm.getArray("data");
171 | ArrayList xVals=new ArrayList();
172 | for(int m=0;m entries=new ArrayList();
177 | for(int i=0;i xVals=new ArrayList();
60 | for(int m=0;m entries=new ArrayList();
71 | for (int j=0;j colors = new ArrayList<>();
89 | for(int c = 0; c < colorsArray.size(); c++){
90 | colors.add(Color.parseColor(colorsArray.getString(c)));
91 | }
92 | dataSet.setValueTextColors(colors);
93 | }else
94 | if(config.hasKey("drawValues")) dataSet.setDrawValues(config.getBoolean("drawValues"));
95 | if(config.hasKey("valueTextColor")) dataSet.setValueTextColor(Color.parseColor(config.getString("valueTextColor")));
96 |
97 | // Text Size for bar value
98 |
99 | if(config.hasKey("valueTextSize")) dataSet.setValueTextSize((float)config.getDouble("valueTextSize"));
100 |
101 | if (config.hasKey("drawCircleHole")) dataSet.setDrawCircleHole(config.getBoolean("drawCircleHole"));
102 | if(config.hasKey("drawStepped")) dataSet.setDrawStepped(config.getBoolean("drawStepped"));
103 | if(config.hasKey("colors")){
104 | ReadableArray colorsArray = config.getArray("colors");
105 | ArrayList colors = new ArrayList<>();
106 | for(int c = 0; c < colorsArray.size(); c++){
107 | colors.add(Color.parseColor(colorsArray.getString(c)));
108 | }
109 | dataSet.setColors(colors);
110 | }else if (config.hasKey("color")) {
111 | int[] colors=new int[]{Color.parseColor(config.getString("color"))};
112 | dataSet.setColors(colors);
113 | }
114 | if(config.hasKey("circleColors")){
115 | ReadableArray colorsArray = config.getArray("circleColors");
116 | ArrayList colors = new ArrayList<>();
117 | for(int c = 0; c < colorsArray.size(); c++){
118 | colors.add(Color.parseColor(colorsArray.getString(c)));
119 | }
120 | dataSet.setCircleColors(colors);
121 | }else if (config.hasKey("circleColor")) {
122 | int[] colors=new int[]{Color.parseColor(config.getString("circleColor"))};
123 | dataSet.setCircleColors(colors);
124 | }
125 | if (config.hasKey("dashedLine")) {
126 | String[] dashedLine = config.getString("dashedLine").split(" ");
127 | dataSet.enableDashedLine(Integer.parseInt(dashedLine[0]), Integer.parseInt(dashedLine[1]), Integer.parseInt(dashedLine[2]));
128 | }
129 |
130 | if (config.hasKey("drawFill")) dataSet.setDrawFilled(config.getBoolean("drawFill"));
131 | if (config.hasKey("fillColor")) dataSet.setFillColor(Color.parseColor(config.getString("fillColor")));
132 | if (config.hasKey("fillAlpha")) dataSet.setFillAlpha((int)(255 * config.getDouble("fillAlpha")));
133 | if (config.hasKey("bezier")) dataSet.setDrawCubic(config.getBoolean("bezier"));
134 | if (config.hasKey("axisDependency")) {
135 | AxisDependency axisDependency = AxisDependency.LEFT;
136 | if (config.getString("axisDependency").equalsIgnoreCase("RIGHT")) {
137 | axisDependency = AxisDependency.RIGHT;
138 | }
139 | dataSet.setAxisDependency(axisDependency);
140 | }
141 |
142 | chartData.addDataSet(dataSet);
143 | }
144 | chart.setData(chartData);
145 |
146 | /**
147 | * Graph animation configurations
148 | * If no animation config provided, call chart.invalidate()
149 | * animation configs are maps with the following keys
150 | * - duration or durationX/durationY in case of animateXY
151 | * - support for easeFunction yet to be given
152 | */
153 | if (rm.hasKey("animateX")) {
154 | chart.animateX(rm.getMap("animateX").getInt("duration"));
155 | } else if (rm.hasKey("animateY")) {
156 | chart.animateY(rm.getMap("animateY").getInt("duration"));
157 | } else if (rm.hasKey("animateXY")) {
158 | ReadableMap animationConfig = rm.getMap("animateXY");
159 | chart.animateXY(
160 | animationConfig.getInt("durationX"),
161 | animationConfig.getInt("durationY")
162 | );
163 | } else {
164 | chart.invalidate();
165 | }
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MPPieChartManager.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.graphics.Color;
4 |
5 | import com.facebook.react.bridge.ReadableArray;
6 | import com.facebook.react.bridge.ReadableMap;
7 | import com.facebook.react.uimanager.annotations.ReactProp;
8 | import com.facebook.react.uimanager.ThemedReactContext;
9 | import com.github.mikephil.charting.charts.PieChart;
10 | import com.github.mikephil.charting.data.PieData;
11 | import com.github.mikephil.charting.data.PieDataSet;
12 | import com.github.mikephil.charting.data.Entry;
13 | import com.github.mikephil.charting.data.DataSet;
14 | import com.github.mikephil.charting.utils.ColorTemplate;
15 | import com.github.mikephil.charting.formatter.PercentFormatter;
16 |
17 |
18 | import java.util.ArrayList;
19 | import java.util.Random;
20 |
21 |
22 | public class MPPieChartManager extends MPPieRadarChartManager {
23 | private String CLASS_NAME="MPPieChart";
24 |
25 | @Override
26 | public String getName() {
27 | return this.CLASS_NAME;
28 | }
29 |
30 | @Override
31 | protected PieChart createViewInstance(ThemedReactContext reactContext) {
32 | PieChart chart=new PieChart(reactContext);
33 |
34 | // initialise event listener to bind to chart
35 | new MPPieChartSelectionEventListener(chart);
36 |
37 | return chart;
38 | }
39 |
40 | // @Override
41 | // protected PieChart createViewInstance(ThemedReactContext reactContext) {
42 | // PieChart chart= new PieChart(reactContext);
43 | // return chart;
44 | // }
45 |
46 | @ReactProp(name = "holeRadius", defaultFloat = 50f)
47 | public void setHoleRadius(PieChart chart, float holeRadius){
48 | chart.setHoleRadius(holeRadius);
49 | chart.invalidate();
50 | }
51 |
52 | @ReactProp(name = "transparentCircleRadius", defaultFloat = 0f)
53 | public void setTransparentCircleRadius(PieChart chart, float transparentCircleRadius){
54 | chart.setTransparentCircleRadius(transparentCircleRadius);
55 | chart.invalidate();
56 | }
57 |
58 | @ReactProp(name="backgroundColor", defaultInt = Color.WHITE)
59 | public void setBackgroundColor(PieChart chart, int backgroundColor){
60 | chart.setBackgroundColor(backgroundColor);
61 | chart.invalidate();
62 | }
63 |
64 | @ReactProp(name="drawSliceText", defaultBoolean = false)
65 | public void setDrawSliceText(PieChart chart, boolean enabled){
66 | chart.setDrawSliceText(enabled);
67 | chart.invalidate();
68 | }
69 |
70 | @ReactProp(name="usePercentValues", defaultBoolean = true)
71 | public void setUsePercentValues(PieChart chart, boolean enabled){
72 | chart.setUsePercentValues(enabled);
73 | chart.invalidate();
74 | }
75 |
76 | @ReactProp(name="centerText")
77 | public void setCenterText(PieChart chart, String v){
78 | chart.setCenterText(v);
79 | chart.invalidate();
80 | }
81 |
82 | @ReactProp(name = "centerTextRadiusPercent", defaultFloat = 1.f)
83 | public void setCenterTextRadiusPercent(PieChart chart, float percent){
84 | chart.setCenterTextRadiusPercent(percent);
85 | chart.invalidate();
86 | }
87 |
88 | @ReactProp(name="data")
89 | public void setData(PieChart chart,ReadableMap rm){
90 |
91 | ReadableArray xArray=rm.getArray("xValues");
92 | ArrayList xVals=new ArrayList();
93 | for(int m=0;m entries=new ArrayList();
106 | for (int j=0;j colors = new ArrayList<>();
119 | for(int c = 0; c < colorsArray.size(); c++){
120 | colors.add(Color.parseColor(colorsArray.getString(c)));
121 | }
122 | dataSet.setColors(colors);
123 | }else
124 | if(config.hasKey("color")) {
125 | int[] colors=new int[]{Color.parseColor(config.getString("color"))};
126 | dataSet.setColors(colors);
127 | }
128 | if(config.hasKey("drawValues")) dataSet.setDrawValues(config.getBoolean("drawValues"));
129 | if(config.hasKey("valueTextColors")){
130 | ReadableArray colorsArray = config.getArray("valueTextColors");
131 | ArrayList colors = new ArrayList<>();
132 | for(int c = 0; c < colorsArray.size(); c++){
133 | colors.add(Color.parseColor(colorsArray.getString(c)));
134 | }
135 | dataSet.setValueTextColors(colors);
136 | }else
137 | if(config.hasKey("valueTextColor")) dataSet.setValueTextColor(Color.parseColor(config.getString("valueTextColor")));
138 | dataSet.setSliceSpace(3f);
139 | pieData.addDataSet(dataSet);
140 |
141 | }
142 | chart.setUsePercentValues(true);
143 | chart.setData(pieData);
144 | chart.invalidate();
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MPPieChartSelectionEventListener.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.view.MotionEvent;
4 |
5 | import com.facebook.react.bridge.Arguments;
6 | import com.facebook.react.bridge.WritableMap;
7 | import com.facebook.react.uimanager.ThemedReactContext;
8 | import com.facebook.react.uimanager.events.RCTEventEmitter;
9 | import com.github.mikephil.charting.charts.PieChart;
10 | import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
11 |
12 | import com.github.mikephil.charting.data.Entry;
13 | import com.github.mikephil.charting.highlight.Highlight;
14 |
15 |
16 | /*
17 | * implement OnChartValueSelectedListener interface to bridge selection callback
18 | * events support
19 | * use eventName 'topSelect' mapping to 'onSelect' callback prop in JS
20 | */
21 | public class MPPieChartSelectionEventListener implements OnChartValueSelectedListener {
22 | private PieChart chart=null;
23 | public MPPieChartSelectionEventListener(){
24 |
25 | }
26 | public MPPieChartSelectionEventListener(PieChart chart){
27 | this.chart=chart;
28 |
29 | // bind selection callback listener to chart
30 | this.chart.setOnChartValueSelectedListener(this);
31 | }
32 |
33 | @Override
34 | public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
35 | WritableMap event = Arguments.createMap();
36 | event.putInt("xIndex", e.getXIndex());
37 | event.putDouble("yValue", e.getVal());
38 |
39 | ThemedReactContext reactContext = (ThemedReactContext)this.chart.getContext();
40 |
41 | reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
42 | this.chart.getId(),
43 | "topSelect",
44 | event
45 | );
46 | }
47 |
48 | @Override
49 | public void onNothingSelected() {
50 | WritableMap event = Arguments.createMap();
51 |
52 | // pass xIndex as -1 for representing no selection
53 | event.putInt("xIndex", -1);
54 |
55 | ThemedReactContext reactContext = (ThemedReactContext)this.chart.getContext();
56 |
57 | reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(
58 | this.chart.getId(),
59 | "topSelect",
60 | event
61 | );
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MPPieRadarChartManager.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.graphics.Color;
4 |
5 | import com.facebook.react.bridge.ReadableArray;
6 | import com.facebook.react.bridge.ReadableMap;
7 | import com.facebook.react.uimanager.annotations.ReactProp;
8 | import com.facebook.react.uimanager.SimpleViewManager;
9 | import com.facebook.react.uimanager.ThemedReactContext;
10 | import com.github.mikephil.charting.charts.PieChart;
11 | import com.github.mikephil.charting.charts.PieRadarChartBase;
12 | import com.github.mikephil.charting.components.Legend;
13 | import com.github.mikephil.charting.data.Entry;
14 | import com.github.mikephil.charting.data.PieData;
15 | import com.github.mikephil.charting.data.PieDataSet;
16 |
17 | import java.util.ArrayList;
18 | import java.util.Random;
19 |
20 | /**
21 | * Created by Administrator on 2015/12/24.
22 | */
23 | public class MPPieRadarChartManager extends SimpleViewManager {
24 | private String CLASS_NAME="PieRadarChart";
25 |
26 | @Override
27 | public String getName() {
28 | return this.CLASS_NAME;
29 | }
30 |
31 | @Override
32 | protected PieRadarChartBase createViewInstance(ThemedReactContext reactContext) {
33 | PieChart chart = new PieChart(reactContext);
34 | return chart;
35 | }
36 |
37 | @ReactProp(name="touchEnabled",defaultBoolean = true)
38 | public void setTouchEnabled(PieRadarChartBase chart,boolean enable){
39 | chart.setTouchEnabled(enable);
40 | }
41 | @ReactProp(name="dragEnabled",defaultBoolean = true)
42 | public void setDragEnabled(PieRadarChartBase chart,boolean enable){
43 | chart.setTouchEnabled(enable);
44 | }
45 |
46 | @ReactProp(name="highlightPerTapEnabled",defaultBoolean = true)
47 | public void setHighlightPerTapEnabled(PieRadarChartBase chart,boolean enable){
48 | chart.setHighlightPerTapEnabled(enable);
49 | }
50 | @ReactProp(name="dragDecelerationEnabled",defaultBoolean = true)
51 | public void setDragDecelerationEnabled(PieRadarChartBase chart,boolean enable){
52 | chart.setDragDecelerationEnabled(enable);
53 | }
54 |
55 | @ReactProp(name="dragDecelerationFrictionCoef",defaultFloat = 0.50f)
56 | public void setDragDecelerationFrictionCoef(PieRadarChartBase chart,float v){
57 | chart.setDragDecelerationFrictionCoef(v);
58 | }
59 |
60 | @ReactProp(name="description")
61 | public void setDescription(PieRadarChartBase chart,String v){
62 | chart.setDescription(v);
63 | }
64 | @ReactProp(name="backgroundColor")
65 | public void setBackgroundColor(PieRadarChartBase chart,String v){
66 | chart.setBackgroundColor(Color.parseColor(v));
67 | }
68 |
69 | @ReactProp(name="chartPadding")
70 | public void setPadding(PieRadarChartBase chart,String v){
71 | String[] padding=v.split(" ");
72 | if(padding.length==1){
73 | int pad=(Integer.parseInt(padding[0]));
74 | chart.setPadding(pad,pad,pad,pad);
75 | }else if(padding.length==2){
76 | int pad1=(Integer.parseInt(padding[0]));
77 | int pad2=(Integer.parseInt(padding[1]));
78 | chart.setPadding(pad2,pad1,pad2,pad1);
79 | }else if(padding.length==4){
80 | int pad1=(Integer.parseInt(padding[0]));
81 | int pad2=(Integer.parseInt(padding[1]));
82 | int pad3=(Integer.parseInt(padding[0]));
83 | int pad4=(Integer.parseInt(padding[1]));
84 | chart.setPadding(pad4,pad1,pad2,pad3);
85 | }
86 | }
87 | @ReactProp(name="legend")
88 | public void setLegend(PieRadarChartBase chart,ReadableMap v){
89 | Legend legend=chart.getLegend();
90 | if(v.hasKey("enable")) legend.setEnabled(v.getBoolean("enable"));
91 | if(v.hasKey("position")) legend.setPosition(Legend.LegendPosition.valueOf(v.getString("position")));
92 | if(v.hasKey("direction")) legend.setDirection(Legend.LegendDirection.valueOf(v.getString("direction")));
93 |
94 | if(v.hasKey("legendForm")) legend.setForm(Legend.LegendForm.valueOf(v.getString("legendForm")));
95 | if(v.hasKey("wordWrap")) legend.setWordWrapEnabled(v.getBoolean("wordWrap"));
96 |
97 | if(v.hasKey("textColor")) legend.setTextColor(Color.parseColor(v.getString("textColor")));
98 | if(v.hasKey("textSize")) legend.setTextSize((float) v.getDouble("textSize"));
99 | if(v.hasKey("xOffset")) legend.setXOffset((float) v.getDouble("xOffset"));
100 | if(v.hasKey("yOffset")) legend.setYOffset((float) v.getDouble("yOffset"));
101 |
102 | if(v.hasKey("custom")){
103 | ReadableMap custom=v.getMap("custom");
104 | ReadableArray colors=custom.getArray("colors");
105 | ReadableArray labels=custom.getArray("labels");
106 | if(colors.size()==labels.size()) {
107 | int[] cols = new int[colors.size()];
108 | String[] labs = new String[colors.size()];
109 | for (int j = 0; j < colors.size(); j++) {
110 | cols[j] = Color.parseColor(colors.getString(j));
111 | labs[j] = labels.getString(j);
112 | }
113 | legend.setCustom(cols,labs);
114 | }
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MPRadarChartManager.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.graphics.Color;
4 | import android.graphics.Typeface;
5 |
6 | import com.facebook.react.bridge.ReadableArray;
7 | import com.facebook.react.bridge.ReadableMap;
8 | import com.facebook.react.uimanager.annotations.ReactProp;
9 | import com.facebook.react.uimanager.ThemedReactContext;
10 | import com.github.mikephil.charting.charts.RadarChart;
11 | import com.github.mikephil.charting.data.RadarData;
12 | import com.github.mikephil.charting.data.RadarDataSet;
13 | import com.github.mikephil.charting.data.Entry;
14 | import com.github.mikephil.charting.data.DataSet;
15 | import com.github.mikephil.charting.utils.ColorTemplate;
16 | import com.github.mikephil.charting.interfaces.datasets.IDataSet;
17 | import com.github.mikephil.charting.interfaces.datasets.IRadarDataSet;
18 |
19 | import java.util.ArrayList;
20 | import java.util.Random;
21 |
22 |
23 | public class MPRadarChartManager extends MPPieRadarChartManager {
24 | private String CLASS_NAME="MPRadarChart";
25 |
26 | @Override
27 | public String getName() {
28 | return this.CLASS_NAME;
29 | }
30 |
31 | @Override
32 | protected RadarChart createViewInstance(ThemedReactContext reactContext) {
33 | RadarChart chart=new RadarChart(reactContext);
34 |
35 | // initialise event listener to bind to chart
36 | // TODO: is it need to move to MPRadarChartSelectionEventListener?
37 | //new MPPieChartSelectionEventListener(chart);
38 |
39 | return chart;
40 | }
41 |
42 | // @Override
43 | // protected PieChart createViewInstance(ThemedReactContext reactContext) {
44 | // PieChart chart= new PieChart(reactContext);
45 | // return chart;
46 | // }
47 |
48 | @ReactProp(name="webLineWidth",defaultFloat=0.5f)
49 | public void setWebLineWidth(RadarChart chart,float webLineWidth){
50 | chart.setWebLineWidth(webLineWidth);
51 | chart.invalidate();
52 | }
53 |
54 | @ReactProp(name="webLineWidthInner",defaultFloat=0.3f)
55 | public void setWebLineWidthInner(RadarChart chart,float webLineWidthInner){
56 | chart.setWebLineWidthInner(webLineWidthInner);
57 | chart.invalidate();
58 | }
59 |
60 | @ReactProp(name="webAlpha",defaultInt=0)
61 | public void setWebAlpha(RadarChart chart,int webAlpha){
62 | chart.setWebAlpha(webAlpha);
63 | chart.invalidate();
64 | }
65 |
66 | @ReactProp(name="webColor",defaultInt=1)
67 | public void setWebColor(RadarChart chart, int webColor){
68 | chart.setWebColor(webColor);
69 | chart.invalidate();
70 | }
71 |
72 | @ReactProp(name="webColorInner",defaultInt=1)
73 | public void setWebColorInner(RadarChart chart,int webColorInner){
74 | chart.setWebColorInner(webColorInner);
75 | chart.invalidate();
76 | }
77 |
78 | @ReactProp(name="drawWeb",defaultBoolean=false)
79 | public void setDrawWeb(RadarChart chart,boolean drawWeb){
80 | chart.setDrawWeb(drawWeb);
81 | chart.invalidate();
82 | }
83 |
84 | @ReactProp(name="skipWebLineCount",defaultInt=0)
85 | public void setSkipWebLineCount(RadarChart chart,int skipWebLineCount){
86 | chart.setSkipWebLineCount(skipWebLineCount);
87 | chart.invalidate();
88 | }
89 |
90 | @ReactProp(name="data")
91 | public void setData(RadarChart chart,ReadableMap rm){
92 |
93 | String name=rm.getString("name");
94 | ReadableArray mdata=rm.getArray("data");
95 | ReadableArray parties=rm.getArray("parties");
96 | ArrayList yVals = new ArrayList();
97 | String[] mParties = new String[parties.size()];
98 | // Adding Parties String
99 | if(mdata.size()!=parties.size()){
100 |
101 | }
102 | for (int m=0;m xVals = new ArrayList();
106 | for (int i = 0; i < parties.size(); i++)
107 | xVals.add(mParties[i % mParties.length]);
108 |
109 | // Adding Data
110 | for (int n=0;n sets = new ArrayList();
122 | sets.add(set);
123 |
124 | RadarData data = new RadarData(xVals, sets);
125 | data.setValueTextSize(8f);
126 | data.setDrawValues(true);
127 | chart.getYAxis().setEnabled(false);
128 | chart.setData(data);
129 |
130 | chart.invalidate();
131 |
132 |
133 | /*
134 | float mult = 150;
135 | int cnt = 9;
136 | ArrayList yVals1 = new ArrayList();
137 | ArrayList yVals2 = new ArrayList();
138 | String[] mParties = new String[]{
139 | "Party A", "Party B", "Party C", "Party D", "Party E", "Party F", "Party G", "Party H",
140 | "Party I"};
141 | // IMPORTANT: In a PieChart, no values (Entry) should have the same
142 | // xIndex (even if from different DataSets), since no values can be
143 | // drawn above each other.
144 | for (int i = 0; i < cnt; i++) {
145 | yVals1.add(new Entry((float) (Math.random() * mult) + mult / 2, i));
146 | }
147 |
148 | for (int i = 0; i < cnt; i++) {
149 | yVals2.add(new Entry((float) (Math.random() * mult) + mult / 2, i));
150 | }
151 |
152 | ArrayList xVals = new ArrayList();
153 |
154 | for (int i = 0; i < cnt; i++)
155 | xVals.add(mParties[i % mParties.length]);
156 |
157 | RadarDataSet set1 = new RadarDataSet(yVals1, "Set 1");
158 | set1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
159 | set1.setFillColor(ColorTemplate.VORDIPLOM_COLORS[0]);
160 | set1.setDrawFilled(true);
161 | set1.setLineWidth(2f);
162 |
163 | RadarDataSet set2 = new RadarDataSet(yVals2, "Set 2");
164 | set2.setColor(ColorTemplate.VORDIPLOM_COLORS[4]);
165 | set2.setFillColor(ColorTemplate.VORDIPLOM_COLORS[4]);
166 | set2.setDrawFilled(true);
167 | set2.setLineWidth(2f);
168 |
169 | ArrayList sets = new ArrayList();
170 | sets.add(set1);
171 | sets.add(set2);
172 |
173 | RadarData data = new RadarData(xVals, sets);
174 | data.setValueTextSize(8f);
175 | data.setDrawValues(false);
176 |
177 | chart.setData(data);
178 |
179 | chart.invalidate();
180 | */
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/android/src/main/java/cn/mandata/react_native_mpchart/MainActivity.java:
--------------------------------------------------------------------------------
1 | package cn.mandata.react_native_mpchart;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.FloatingActionButton;
5 | import android.support.design.widget.Snackbar;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 |
10 | public class MainActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_main);
16 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
17 | setSupportActionBar(toolbar);
18 |
19 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
20 | fab.setOnClickListener(new View.OnClickListener() {
21 | @Override
22 | public void onClick(View view) {
23 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
24 | .setAction("Action", null).show();
25 | }
26 | });
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/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/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
23 |
24 |
32 |
33 |
--------------------------------------------------------------------------------
/android/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hongyin163/react-native-chart-android/eeba3aced601eafe34bad33f784ea55bf81f0fa6/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/eeba3aced601eafe34bad33f784ea55bf81f0fa6/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/eeba3aced601eafe34bad33f784ea55bf81f0fa6/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/eeba3aced601eafe34bad33f784ea55bf81f0fa6/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/eeba3aced601eafe34bad33f784ea55bf81f0fa6/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/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/main/res/values/attrs_chart_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | react-native-mpchart
3 | Settings
4 | MainActivity
5 |
6 |
--------------------------------------------------------------------------------
/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-chart-android",
3 | "version": "1.0.8",
4 | "description": "react-native-mpchart provide modules to add chart to android,all charts are come from mpandroidchart library.",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/hongyin163/react-native-chart-android.git"
12 | },
13 | "keywords": [
14 | "chart",
15 | "mpandroidchart"
16 | ],
17 | "author": "hongyin163",
18 | "license": "MIT",
19 | "bugs": {
20 | "url": "https://github.com/hongyin163/react-native-chart-android/issues"
21 | },
22 | "homepage": "https://github.com/hongyin163/react-native-chart-android#readme",
23 | "dependencies": {
24 | "prop-types": "^15.5.10"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/sample/BarChart.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 | var TitleBar=require('./TitleBar');
6 | var {
7 | BarChart,
8 | CombinedChart
9 | }=require('../index.android');
10 | var {
11 | StyleSheet,
12 | View,
13 | Text
14 | } = React;
15 |
16 | var Component = React.createClass({
17 | getBarData:function (argument) {
18 | var data={
19 | xValues:['1','2','3'],
20 | yValues:[
21 | {
22 | data:[4.0,5.0,6.0],
23 | label:'test1',
24 | config:{
25 | color:'blue'
26 | }
27 | },
28 | {
29 | data:[4.0,5.0,6.0],
30 | label:'test2',
31 | config:{
32 | color:'red'
33 | }
34 | },
35 | {
36 | data:[4.0,5.0,6.0],
37 | label:'test2',
38 | config:{
39 | color:'yellow'
40 | }
41 | }
42 | ]
43 | };
44 | return data;
45 | },
46 | getRandomData:function (argument) {
47 | var data={};
48 | data['xValues']=[];
49 | data['yValues']=[
50 | {
51 | data:[],
52 | label:'test1',
53 | config:{
54 | color:'blue'
55 | }
56 | }
57 | ];
58 | for (var i = 0; i < 500; i++) {
59 | data.xValues.push(i+'');
60 | data.yValues[0].data.push(Math.random()*100);
61 | };
62 | return data;
63 | },
64 | render: function() {
65 | return (
66 |
67 |
68 |
69 |
70 |
83 |
84 |
85 | );
86 | }
87 | });
88 |
89 | var styles = StyleSheet.create({
90 | container:{
91 | flex:1
92 | },
93 | chartContainer:{
94 | flex:1
95 | },
96 | chart:{
97 | flex:1
98 | }
99 | });
100 |
101 |
102 | module.exports = Component;
103 |
--------------------------------------------------------------------------------
/sample/Button.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 |
6 | var {
7 | StyleSheet,
8 | View,
9 | TouchableOpacity,
10 | Text
11 | } = React;
12 |
13 | var Button = React.createClass({
14 | onPress:function (argument) {
15 | this.props.onPress&&this.props.onPress();
16 | },
17 | render: function() {
18 | return (
19 |
20 |
21 | {this.props.text}
22 |
23 |
24 | );
25 | }
26 | });
27 |
28 |
29 | var styles = StyleSheet.create({
30 | button:{
31 | height:50,
32 | justifyContent:'center',
33 | alignItems: 'center',
34 | borderBottomWidth:1,
35 | borderBottomColor:'#e5e5e5'
36 | }
37 | });
38 |
39 |
40 | module.exports = Button;
41 |
--------------------------------------------------------------------------------
/sample/CandleChart.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 | var TitleBar=require('./TitleBar');
6 | var {
7 | CombinedChart
8 | }=require('../index.android');
9 | var {
10 | StyleSheet,
11 | View,
12 | Text
13 | } = React;
14 | var dayData=[['20130522',8.15,8.18,8.27,8.01,619925.00,-0.01,0.00,8.19,0.00],['20130523',8.14,8.08,8.44,8.06,926195.00,-0.10,-0.01,8.18,0.00],['20130524',8.15,8.27,8.34,8.09,549492.00,0.19,0.02,8.08,0.00],['20130527',8.25,8.17,8.39,8.02,570167.00,-0.10,-0.01,8.27,0.00],['20130528',8.18,8.06,8.24,7.91,477382.00,-0.11,-0.01,8.17,0.00],['20130529',8.05,8.28,8.38,8.04,581968.00,0.22,0.03,8.06,0.00],['20130530',8.21,8.17,8.28,8.09,367393.00,-0.11,-0.01,8.28,0.00],['20130531',8.20,8.15,8.35,8.08,414219.00,-0.02,0.00,8.17,0.00],['20130603',8.15,7.98,8.18,7.95,339263.00,-0.17,-0.02,8.15,0.00],['20130604',8.00,7.82,8.00,7.79,295004.00,-0.16,-0.02,7.98,0.00],['20130605',7.82,7.85,7.93,7.75,193533.00,0.03,0.00,7.82,0.00],['20130606',7.84,7.76,7.95,7.75,216594.00,-0.09,-0.01,7.85,0.00],['20130607',7.78,7.52,7.86,7.47,272801.00,-0.24,-0.03,7.76,0.00],['20130613',7.44,7.28,7.44,7.12,231118.00,-0.24,-0.03,7.52,0.00],['20130614',7.31,7.36,7.45,7.26,203622.00,0.08,0.01,7.28,0.00],['20130617',7.43,7.26,7.45,7.24,183472.00,-0.10,-0.01,7.36,0.00],['20130618',7.29,7.79,7.97,7.24,540692.00,0.53,0.07,7.26,0.00],['20130619',7.68,7.60,7.73,7.50,303383.00,-0.19,-0.02,7.79,0.00],['20130627',7.13,6.99,7.37,6.95,611673.00,-0.61,-0.08,7.60,0.00],['20130628',6.75,6.86,6.99,6.71,312560.00,-0.13,-0.02,6.99,0.00],['20130701',6.84,6.98,6.99,6.80,167387.00,0.12,0.02,6.86,0.00],['20130702',7.01,7.02,7.08,6.92,206893.00,0.04,0.01,6.98,0.00],['20130703',7.01,7.09,7.20,6.69,341783.00,0.07,0.01,7.02,0.00],['20130704',7.00,7.07,7.20,6.94,250187.00,-0.02,0.00,7.09,0.00],['20130705',7.09,7.00,7.13,6.99,188851.00,-0.07,-0.01,7.07,0.00],['20130708',6.89,6.65,6.89,6.65,210585.00,-0.35,-0.05,7.00,0.00],['20130709',6.61,6.69,6.73,6.55,142780.00,0.04,0.01,6.65,0.00],['20130710',6.70,6.93,6.96,6.70,193758.00,0.24,0.04,6.69,0.00],['20130711',6.94,7.09,7.15,6.87,289551.00,0.16,0.02,6.93,0.00],['20130712',7.07,7.05,7.29,7.04,281348.00,-0.04,-0.01,7.09,0.00],['20130715',7.12,7.28,7.32,7.12,300534.00,0.23,0.03,7.05,0.00],['20130716',7.30,7.33,7.36,7.18,264920.00,0.05,0.01,7.28,0.00],['20130717',7.32,7.27,7.50,7.24,300561.00,-0.06,-0.01,7.33,0.00],['20130718',7.26,7.43,7.52,7.22,338425.00,0.16,0.02,7.27,0.00],['20130719',7.44,7.34,7.74,7.34,532460.00,-0.09,-0.01,7.43,0.00],['20130722',7.23,7.66,7.70,7.20,432743.00,0.32,0.04,7.34,0.00],['20130723',7.63,7.75,7.88,7.61,546163.00,0.09,0.01,7.66,0.00],['20130724',7.74,7.91,8.20,7.57,691613.00,0.16,0.02,7.75,0.00],['20130725',7.83,7.52,7.89,7.50,484585.00,-0.39,-0.05,7.91,0.00],['20130726',7.55,7.83,7.85,7.46,438687.00,0.31,0.04,7.52,0.00],['20130729',7.76,7.71,8.00,7.65,391288.00,-0.12,-0.02,7.83,0.00],['20130730',7.77,7.59,7.80,7.48,237147.00,-0.12,-0.02,7.71,0.00],['20130731',7.64,7.70,7.86,7.56,359582.00,0.11,0.01,7.59,0.00],['20130801',7.69,7.99,8.10,7.66,600381.00,0.29,0.04,7.70,0.00],['20130802',8.04,8.10,8.27,7.95,669398.00,0.11,0.01,7.99,0.00],['20130805',8.09,8.14,8.18,7.98,397040.00,0.04,0.00,8.10,0.00],['20130806',8.16,8.09,8.25,8.01,551444.00,-0.05,-0.01,8.14,0.00],['20130807',8.03,7.80,8.05,7.77,505454.00,-0.29,-0.04,8.09,0.00],['20130808',7.78,7.88,8.03,7.76,344456.00,0.08,0.01,7.80,0.00],['20130809',7.90,7.79,7.96,7.70,269801.00,-0.09,-0.01,7.88,0.00],['20130812',7.79,8.00,8.03,7.79,422066.00,0.21,0.03,7.79,0.00],['20130813',8.05,7.97,8.05,7.89,325471.00,-0.03,0.00,8.00,0.00],['20130814',8.00,8.40,8.68,7.93,1349693.00,0.43,0.05,7.97,0.00],['20130815',8.37,8.19,8.44,8.17,661746.00,-0.21,-0.03,8.40,0.00],['20130816',8.15,8.05,9.00,8.01,1000456.00,-0.14,-0.02,8.19,0.00],['20130819',8.00,8.37,8.46,8.00,606257.00,0.32,0.04,8.05,0.00],['20130820',8.35,8.36,8.53,8.26,526356.00,-0.01,0.00,8.37,0.00],['20130821',8.32,8.68,8.75,8.20,921946.00,0.32,0.04,8.36,0.00],['20130822',8.60,8.84,9.18,8.60,1372582.00,0.16,0.02,8.68,0.00],['20130823',8.87,8.72,8.99,8.43,920963.00,-0.12,-0.01,8.84,0.00],['20130826',8.71,9.29,9.50,8.68,1250656.00,0.57,0.07,8.72,0.00],['20130827',9.21,9.26,9.36,9.05,773300.00,-0.03,0.00,9.29,0.00],['20130828',9.12,8.89,9.23,8.87,745923.00,-0.37,-0.04,9.26,0.00],['20130829',8.86,8.91,9.06,8.73,473441.00,0.02,0.00,8.89,0.00],['20130830',8.92,8.54,8.95,8.41,824152.00,-0.37,-0.04,8.91,0.00],['20130902',8.48,8.64,8.79,8.48,363879.00,0.10,0.01,8.54,0.00],['20130903',8.63,8.80,8.93,8.48,453066.00,0.16,0.02,8.64,0.00],['20130904',8.74,8.66,8.78,8.61,265338.00,-0.14,-0.02,8.80,0.00],['20130905',8.61,8.70,8.85,8.61,342365.00,0.04,0.00,8.66,0.00],['20130906',8.69,8.72,8.78,8.61,302729.00,0.02,0.00,8.70,0.00],['20130909',8.76,8.81,8.84,8.64,418174.00,0.09,0.01,8.72,0.00],['20130910',8.83,9.04,9.07,8.81,511273.00,0.23,0.03,8.81,0.00],['20130911',9.02,8.79,9.15,8.75,455728.00,-0.25,-0.03,9.04,0.00],['20130912',8.79,8.60,8.96,8.52,483565.00,-0.19,-0.02,8.79,0.00],['20130913',8.64,8.71,8.74,8.54,294939.00,0.11,0.01,8.60,0.00],['20130916',8.70,8.50,8.70,8.46,330778.00,-0.21,-0.02,8.71,0.00],['20130917',8.53,8.35,8.56,8.34,258655.00,-0.15,-0.02,8.50,0.00],['20130918',8.36,8.47,8.50,8.35,173626.00,0.12,0.01,8.35,0.00],['20130923',8.53,8.73,8.80,8.49,351713.00,0.26,0.03,8.47,0.00],['20130924',8.75,8.73,8.94,8.70,376428.00,0.00,0.00,8.73,0.00],['20130925',8.70,8.98,9.07,8.61,678260.00,0.25,0.03,8.73,0.00],['20130926',9.01,8.76,9.06,8.76,469232.00,-0.22,-0.02,8.98,0.00],['20130927',8.70,8.56,8.80,8.54,280348.00,-0.20,-0.02,8.76,0.00],['20130930',8.69,9.30,9.42,8.63,1064394.00,0.74,0.09,8.56,0.00],['20131008',9.28,9.51,9.63,9.17,1064273.00,0.21,0.02,9.30,0.00],['20131009',9.41,9.32,9.48,9.25,589454.00,-0.19,-0.02,9.51,0.00],['20131010',9.30,9.40,9.75,9.27,763183.00,0.08,0.01,9.32,0.00],['20131011',9.49,9.58,9.69,9.34,664890.00,0.18,0.02,9.40,0.00],['20131014',9.59,9.33,9.63,9.28,559656.00,-0.25,-0.03,9.58,0.00],['20131015',9.36,9.71,9.76,9.23,690034.00,0.38,0.04,9.33,0.00],['20131016',9.65,9.22,9.73,9.08,623181.00,-0.49,-0.05,9.71,0.00],['20131017',9.32,9.10,9.38,9.07,369756.00,-0.12,-0.01,9.22,0.00],['20131018',9.12,9.29,9.34,9.03,263896.00,0.19,0.02,9.10,0.00],['20131021',9.30,9.66,9.85,9.30,681585.00,0.37,0.04,9.29,0.00],['20131022',9.64,9.40,9.83,9.35,586146.00,-0.26,-0.03,9.66,0.00],['20131023',9.45,9.10,9.56,9.04,423001.00,-0.30,-0.03,9.40,0.00],['20131024',9.20,9.12,9.23,9.08,200346.00,0.02,0.00,9.10,0.00],['20131025',9.10,8.73,9.21,8.65,405561.00,-0.39,-0.04,9.12,0.00],['20131028',8.75,8.73,8.81,8.66,182314.00,0.00,0.00,8.73,0.00],['20131029',8.76,8.38,8.81,7.92,404488.00,-0.35,-0.04,8.73,0.00],['20131030',8.35,8.44,8.49,8.25,222993.00,0.06,0.01,8.38,0.00],['20131031',8.61,8.61,8.86,8.55,398816.00,0.17,0.02,8.44,0.00],['20131101',8.60,8.61,8.75,8.50,176033.00,0.00,0.00,8.61,0.00],['20131104',8.65,8.75,8.89,8.65,197407.00,0.14,0.02,8.61,0.00],['20131105',8.68,8.82,8.84,8.54,162404.00,0.07,0.01,8.75,0.00],['20131106',8.78,8.75,8.98,8.70,239275.00,-0.07,-0.01,8.82,0.00],['20131107',8.69,8.51,8.72,8.48,185666.00,-0.24,-0.03,8.75,0.00],['20131108',8.60,8.55,8.73,8.51,178184.00,0.04,0.00,8.51,0.00],['20131111',8.48,8.42,8.56,8.32,125893.00,-0.13,-0.02,8.55,0.00],['20131112',8.46,8.54,8.55,8.39,157976.00,0.12,0.01,8.42,0.00],['20131113',8.62,8.49,8.75,8.48,225546.00,-0.05,-0.01,8.54,0.00],['20131114',8.50,8.94,8.98,8.50,421011.00,0.45,0.05,8.49,0.00],['20131115',8.97,9.07,9.27,8.90,454633.00,0.13,0.01,8.94,0.00],['20131118',9.25,9.26,9.35,9.13,492394.00,0.19,0.02,9.07,0.00],['20131119',9.26,9.14,9.27,9.07,282168.00,-0.12,-0.01,9.26,0.00],['20131120',9.19,9.45,9.54,9.16,531393.00,0.31,0.03,9.14,0.00],['20131121',9.42,9.39,9.57,9.32,370633.00,-0.06,-0.01,9.45,0.00],['20131122',9.42,9.15,9.47,9.10,339996.00,-0.24,-0.03,9.39,0.00],['20131125',9.18,9.68,9.75,9.14,797103.00,0.53,0.06,9.15,0.00],['20131126',9.61,9.67,9.79,9.50,540930.00,-0.01,0.00,9.68,0.00],['20131127',9.61,9.63,9.72,9.49,520693.00,-0.04,0.00,9.67,0.00],['20131128',9.67,9.52,9.82,9.49,552004.00,-0.11,-0.01,9.63,0.00],['20131129',9.52,9.54,9.60,9.46,296275.00,0.02,0.00,9.52,0.00],['20131202',9.45,9.88,10.04,9.35,1321137.00,0.34,0.04,9.54,0.00],['20131203',9.76,9.86,9.95,9.61,653604.00,-0.02,0.00,9.88,0.00],['20131204',9.82,9.90,10.13,9.77,665268.00,0.04,0.00,9.86,0.00],['20131205',9.97,10.40,10.81,9.88,1248902.00,0.50,0.05,9.90,0.00],['20131206',10.33,10.34,10.65,10.26,801977.00,-0.06,-0.01,10.40,0.00],['20131209',10.45,10.37,10.53,10.23,403381.00,0.03,0.00,10.34,0.00],['20131210',10.36,10.39,10.60,10.29,548430.00,0.02,0.00,10.37,0.00],['20131211',10.30,10.05,10.34,9.92,629183.00,-0.34,-0.03,10.39,0.00],['20131212',9.97,9.98,10.12,9.93,365582.00,-0.07,-0.01,10.05,0.00],['20131213',9.92,10.02,10.14,9.89,381871.00,0.04,0.00,9.98,0.00],['20131216',10.06,9.55,10.08,9.55,499145.00,-0.47,-0.05,10.02,0.00],['20131217',9.58,9.48,9.64,9.44,262960.00,-0.07,-0.01,9.55,0.00],['20131218',9.51,9.53,9.68,9.46,221885.00,0.05,0.01,9.48,0.00],['20131219',9.57,9.47,9.74,9.46,276014.00,-0.06,-0.01,9.53,0.00],['20131220',9.52,9.42,9.63,9.39,258512.00,-0.05,-0.01,9.47,0.00],['20131223',9.48,9.42,9.54,9.29,211210.00,0.00,0.00,9.42,0.00],['20131224',9.48,9.76,9.81,9.45,428145.00,0.34,0.04,9.42,0.00],['20131225',9.72,9.89,9.90,9.67,357114.00,0.13,0.01,9.76,0.00],['20131226',9.89,9.49,9.93,9.48,343479.00,-0.40,-0.04,9.89,0.00],['20131227',9.45,10.08,10.17,9.45,636103.00,0.59,0.06,9.49,0.00],['20131230',10.10,10.26,10.27,10.04,444805.00,0.18,0.02,10.08,0.00],['20131231',10.19,10.17,10.33,10.03,295768.00,-0.09,-0.01,10.26,0.00],['20140102',10.16,10.19,10.27,10.02,286816.00,0.02,0.00,10.17,0.00],['20140103',10.17,10.06,10.18,9.92,352055.00,-0.13,-0.01,10.19,0.00],['20140106',10.00,9.54,10.01,9.53,411090.00,-0.52,-0.05,10.06,0.00],['20140107',9.50,9.62,9.66,9.46,256049.00,0.08,0.01,9.54,0.00],['20140108',9.65,9.75,9.86,9.56,272542.00,0.13,0.01,9.62,0.00],['20140109',9.68,9.60,10.03,9.57,365236.00,-0.15,-0.02,9.75,0.00],['20140110',9.55,9.85,9.98,9.44,395077.00,0.25,0.03,9.60,0.00],['20140113',9.89,9.75,10.06,9.62,282233.00,-0.10,-0.01,9.85,0.00],['20140114',9.75,9.68,9.80,9.32,397487.00,-0.07,-0.01,9.75,0.00],['20140115',9.65,10.26,10.29,9.55,758864.00,0.58,0.06,9.68,0.00],['20140116',10.16,10.12,10.29,10.07,428714.00,-0.14,-0.01,10.26,0.00],['20140117',10.08,10.08,10.37,10.05,468519.00,-0.04,0.00,10.12,0.00],['20140120',10.04,10.29,10.36,9.99,577164.00,0.21,0.02,10.08,0.00],['20140121',10.27,10.33,10.44,10.19,568440.00,0.04,0.00,10.29,0.00],['20140122',10.35,10.49,10.53,10.26,630812.00,0.16,0.02,10.33,0.00],['20140123',10.45,10.84,10.96,10.42,953813.00,0.35,0.03,10.49,0.00],['20140124',10.78,10.83,10.91,10.73,557267.00,-0.01,0.00,10.84,0.00],['20140127',10.77,10.50,11.05,10.44,796598.00,-0.33,-0.03,10.83,0.00],['20140128',10.53,10.65,10.99,10.53,642421.00,0.15,0.01,10.50,0.00],['20140129',10.71,11.12,11.20,10.51,807429.00,0.47,0.04,10.65,0.00],['20140130',11.05,10.90,11.18,10.87,482699.00,-0.22,-0.02,11.12,0.00],['20140207',10.69,11.31,11.43,10.68,704106.00,0.41,0.04,10.90,0.00],['20140210',11.28,11.47,11.56,11.28,712684.00,0.16,0.01,11.31,0.00],['20140211',11.46,11.46,11.58,11.28,718870.00,-0.01,0.00,11.47,0.00],['20140212',11.43,11.37,11.46,11.24,463628.00,-0.09,-0.01,11.46,0.00],['20140213',11.34,10.86,11.35,10.85,631669.00,-0.51,-0.04,11.37,0.00],['20140214',10.87,10.99,11.08,10.85,322028.00,0.13,0.01,10.86,0.00],['20140217',10.99,11.25,11.30,10.93,407148.00,0.26,0.02,10.99,0.00],['20140218',11.25,10.99,11.25,10.95,411397.00,-0.26,-0.02,11.25,0.00],['20140219',11.01,11.41,11.63,11.01,817370.00,0.42,0.04,10.99,0.00],['20140220',11.35,11.03,11.45,11.01,573263.00,-0.38,-0.03,11.41,0.00],['20140221',11.07,10.83,11.11,10.70,429824.00,-0.20,-0.02,11.03,0.00],['20140224',10.78,10.98,11.02,10.63,298783.00,0.15,0.01,10.83,0.00],['20140225',10.93,10.69,11.33,10.55,577942.00,-0.29,-0.03,10.98,0.00],['20140226',10.60,10.58,10.64,10.29,376162.00,-0.11,-0.01,10.69,0.00],['20140227',10.60,10.38,10.86,10.36,367781.00,-0.20,-0.02,10.58,0.00],['20140228',10.58,10.75,10.80,10.32,380899.00,0.37,0.04,10.38,0.00],['20140303',10.96,10.94,11.15,10.82,411468.00,0.19,0.02,10.75,0.00],['20140304',10.86,10.78,10.88,10.52,317233.00,-0.16,-0.01,10.94,0.00],['20140305',10.85,10.79,11.04,10.71,272041.00,0.01,0.00,10.78,0.00],['20140306',10.76,10.64,10.85,10.45,280757.00,-0.15,-0.01,10.79,0.00],['20140307',10.66,10.45,10.69,10.38,287540.00,-0.19,-0.02,10.64,0.00],['20140310',10.51,10.19,10.56,10.05,366713.00,-0.26,-0.02,10.45,0.00],['20140311',10.09,9.91,10.15,9.78,371884.00,-0.28,-0.03,10.19,0.00],['20140312',9.93,9.91,10.02,9.67,277951.00,0.00,0.00,9.91,0.00],['20140313',9.95,9.94,10.08,9.85,346587.00,0.03,0.00,9.91,0.00],['20140314',9.93,10.00,10.10,9.88,285131.00,0.06,0.01,9.94,0.00],['20140317',10.03,10.18,10.19,10.00,283234.00,0.18,0.02,10.00,0.00],['20140318',10.20,10.10,10.23,10.07,233056.00,-0.08,-0.01,10.18,0.00],['20140319',10.10,10.12,10.17,9.92,311440.00,0.02,0.00,10.10,0.00],['20140320',10.11,9.85,10.19,9.82,214433.00,-0.27,-0.03,10.12,0.00],['20140321',9.76,9.94,9.98,9.43,314530.00,0.09,0.01,9.85,0.00],['20140324',9.86,9.76,9.94,9.66,313663.00,-0.18,-0.02,9.94,0.00],['20140325',9.69,9.61,9.74,9.45,412471.00,-0.15,-0.02,9.76,0.00],['20140326',9.60,9.69,9.85,9.56,270759.00,0.08,0.01,9.61,0.00],['20140327',9.69,9.51,9.74,9.48,214172.00,-0.18,-0.02,9.69,0.00],['20140328',9.50,9.21,9.60,9.18,242095.00,-0.30,-0.03,9.51,0.00],['20140331',9.19,9.07,9.25,8.89,289187.00,-0.14,-0.02,9.21,0.00],['20140401',9.05,9.21,9.24,9.01,150790.00,0.14,0.02,9.07,0.00],['20140402',9.22,9.11,9.23,9.01,198711.00,-0.10,-0.01,9.21,0.00],['20140403',9.12,9.15,9.24,9.05,162429.00,0.04,0.00,9.11,0.00],['20140404',9.10,9.25,9.25,9.10,146011.00,0.10,0.01,9.15,0.00],['20140408',9.21,9.31,9.38,9.16,244685.00,0.06,0.01,9.25,0.00],['20140409',9.37,9.40,9.43,9.32,221462.00,0.09,0.01,9.31,0.00],['20140410',9.44,9.43,9.46,9.33,245670.00,0.03,0.00,9.40,0.00],['20140411',9.40,9.19,9.40,9.14,292112.00,-0.24,-0.03,9.43,0.00],['20140414',9.14,9.26,9.29,9.09,203948.00,0.07,0.01,9.19,0.00],['20140415',9.23,9.07,9.25,9.05,219163.00,-0.19,-0.02,9.26,0.00],['20140416',9.06,9.20,9.25,9.06,153474.00,0.13,0.01,9.07,0.00],['20140417',9.25,9.24,9.33,9.19,184021.00,0.04,0.00,9.20,0.00],['20140418',8.97,8.82,8.97,8.76,595267.00,-0.42,-0.05,9.24,0.00],['20140421',8.76,8.77,8.89,8.68,210818.00,-0.05,-0.01,8.82,0.00],['20140422',8.71,8.74,8.86,8.62,192335.00,-0.03,0.00,8.77,0.00],['20140423',8.74,8.87,8.92,8.72,167678.00,0.13,0.01,8.74,0.00],['20140424',8.89,8.66,8.89,8.63,150752.00,-0.21,-0.02,8.87,0.00],['20140425',8.67,8.43,8.76,8.42,173889.00,-0.23,-0.03,8.66,0.00],['20140428',8.41,8.07,8.42,8.05,213455.00,-0.36,-0.04,8.43,0.00],['20140429',8.07,8.20,8.21,8.05,143943.00,0.13,0.02,8.07,0.00],['20140430',8.00,7.99,8.03,7.69,432033.00,-0.21,-0.03,8.20,0.00],['20140505',7.93,8.08,8.10,7.87,175518.00,0.09,0.01,7.99,0.00],['20140506',8.07,8.07,8.15,8.00,127677.00,-0.01,0.00,8.08,0.00],['20140507',8.03,7.91,8.12,7.89,147399.00,-0.16,-0.02,8.07,0.00],['20140508',7.88,7.85,8.08,7.83,156562.00,-0.06,-0.01,7.91,0.00],['20140509',7.85,7.71,7.91,7.65,167215.00,-0.14,-0.02,7.85,0.00],['20140512',7.81,7.93,7.94,7.77,206553.00,0.22,0.03,7.71,0.00],['20140513',7.93,8.02,8.04,7.88,180881.00,0.09,0.01,7.93,0.00],['20140514',8.01,7.99,8.08,7.97,112036.00,-0.03,0.00,8.02,0.00],['20140515',7.99,8.01,8.08,7.96,183570.00,0.02,0.00,7.99,0.00],['20140516',8.03,7.94,8.05,7.81,102345.00,-0.07,-0.01,8.01,0.00],['20140519',7.90,7.84,7.93,7.75,96749.00,-0.10,-0.01,7.94,0.00],['20140520',7.89,8.01,8.08,7.83,192499.00,0.17,0.02,7.84,0.00],['20140521',7.96,8.05,8.08,7.93,189160.00,0.04,0.00,8.01,0.00],['20140522',8.06,8.02,8.12,8.00,180943.00,-0.03,0.00,8.05,0.00],['20140523',8.01,8.30,8.36,7.97,343924.00,0.28,0.03,8.02,0.00],['20140526',8.32,8.25,8.32,8.18,241318.00,-0.05,-0.01,8.30,0.00],['20140527',8.22,8.29,8.42,8.20,243399.00,0.04,0.00,8.25,0.00],['20140528',8.32,8.60,8.71,8.26,523780.00,0.31,0.04,8.29,0.00],['20140617',8.80,8.98,9.38,8.70,957348.00,0.38,0.04,8.60,0.00],['20140618',8.90,8.66,8.96,8.62,398802.00,-0.32,-0.04,8.98,0.00],['20140619',8.67,8.50,8.89,8.38,281563.00,-0.16,-0.02,8.66,0.00],['20140620',8.51,8.56,8.60,8.38,159433.00,0.06,0.01,8.50,0.00],['20140623',8.58,8.59,8.74,8.51,228303.00,0.03,0.00,8.56,0.00],['20140624',8.53,8.71,8.78,8.49,208165.00,0.12,0.01,8.59,0.00],['20140625',8.76,8.76,8.87,8.59,249708.00,0.05,0.01,8.71,0.00],['20140626',8.74,8.89,8.96,8.72,264997.00,0.13,0.01,8.76,0.00],['20140627',8.84,8.90,8.97,8.81,178497.00,0.01,0.00,8.89,0.00],['20140630',8.89,8.91,8.99,8.82,188787.00,0.01,0.00,8.90,0.00],['20140701',8.95,8.88,8.96,8.78,249593.00,-0.03,0.00,8.91,0.00],['20140702',8.87,8.78,8.88,8.66,237114.00,-0.10,-0.01,8.88,0.00],['20140703',8.73,8.81,8.88,8.73,162720.00,0.03,0.00,8.78,0.00],['20140704',8.74,8.58,8.75,8.56,204477.00,-0.23,-0.03,8.81,0.00],['20140707',8.53,8.45,8.62,8.40,224099.00,-0.13,-0.02,8.58,0.00],['20140708',8.44,8.61,8.64,8.42,196601.00,0.16,0.02,8.45,0.00],['20140709',8.62,8.43,8.62,8.41,178985.00,-0.18,-0.02,8.61,0.00],['20140710',8.42,8.40,8.56,8.38,121933.00,-0.03,0.00,8.43,0.00],['20140711',8.42,8.53,8.56,8.42,169470.00,0.13,0.02,8.40,0.00],['20140714',8.55,8.60,8.61,8.44,257411.00,0.07,0.01,8.53,0.00],['20140715',8.60,8.92,9.08,8.57,593269.00,0.32,0.04,8.60,0.00],['20140716',8.86,8.79,8.89,8.72,222306.00,-0.13,-0.01,8.92,0.00],['20140717',8.86,8.91,9.02,8.79,322874.00,0.12,0.01,8.79,0.00],['20140718',8.85,8.82,8.97,8.80,198697.00,-0.09,-0.01,8.91,0.00],['20140721',8.75,8.72,8.85,8.66,138337.00,-0.10,-0.01,8.82,0.00],['20140722',8.75,8.81,8.92,8.70,198057.00,0.09,0.01,8.72,0.00],['20140723',8.87,8.76,8.90,8.70,175819.00,-0.05,-0.01,8.81,0.00],['20140724',8.76,8.87,8.88,8.65,210002.00,0.11,0.01,8.76,0.00],['20140725',8.88,8.95,8.98,8.82,224956.00,0.08,0.01,8.87,0.00],['20140728',9.01,9.08,9.17,8.97,412296.00,0.13,0.01,8.95,0.00],['20140729',9.10,9.03,9.20,9.01,302172.00,-0.05,-0.01,9.08,0.00],['20140730',9.05,9.15,9.16,8.91,337180.00,0.12,0.01,9.03,0.00],['20140731',9.15,9.16,9.28,9.12,263873.00,0.01,0.00,9.15,0.00],['20140801',9.10,8.96,9.16,8.94,315234.00,-0.20,-0.02,9.16,0.00],['20140804',8.95,9.11,9.14,8.94,262994.00,0.15,0.02,8.96,0.00],['20140805',9.11,9.20,9.24,9.01,345854.00,0.09,0.01,9.11,0.00],['20140806',9.18,9.65,9.75,9.13,831538.00,0.45,0.05,9.20,0.00],['20140807',9.67,9.49,9.68,9.43,574130.00,-0.16,-0.02,9.65,0.00],['20140808',9.49,9.51,9.63,9.45,300152.00,0.02,0.00,9.49,0.00],['20140811',9.50,9.60,9.68,9.46,411900.00,0.09,0.01,9.51,0.00],['20140812',9.56,9.62,9.78,9.54,435241.00,0.02,0.00,9.60,0.00],['20140813',9.56,9.47,9.64,9.36,330970.00,-0.15,-0.02,9.62,0.00],['20140814',9.48,9.46,9.60,9.40,256614.00,-0.01,0.00,9.47,0.00],['20140815',9.46,9.54,9.66,9.40,388942.00,0.08,0.01,9.46,0.00],['20140818',9.64,9.68,9.75,9.54,425662.00,0.14,0.01,9.54,0.00],['20140819',9.71,9.98,10.17,9.68,855751.00,0.30,0.03,9.68,0.00],['20140820',9.93,10.07,10.25,9.92,522739.00,0.09,0.01,9.98,0.00],['20140821',10.16,10.21,10.37,10.09,509630.00,0.14,0.01,10.07,0.00],['20140822',10.20,10.11,10.20,10.04,307032.00,-0.10,-0.01,10.21,0.00],['20140825',10.11,9.91,10.34,9.90,387576.00,-0.20,-0.02,10.11,0.00],['20140826',9.89,9.92,10.09,9.87,311053.00,0.01,0.00,9.91,0.00],['20140827',9.91,10.27,10.39,9.91,481562.00,0.35,0.04,9.92,0.00],['20140828',10.27,10.29,10.44,10.13,412213.00,0.02,0.00,10.27,0.00],['20140829',10.29,10.54,10.59,10.28,513400.00,0.25,0.02,10.29,0.00],['20140901',10.44,10.45,10.58,10.34,534082.00,-0.09,-0.01,10.54,0.00],['20140902',10.48,10.55,10.64,10.35,506414.00,0.10,0.01,10.45,0.00],['20140903',10.55,10.41,10.66,10.38,468450.00,-0.14,-0.01,10.55,0.00],['20140904',10.41,10.57,10.60,10.36,470757.00,0.16,0.02,10.41,0.00],['20140905',10.59,10.57,10.66,10.46,366093.00,0.00,0.00,10.57,0.00],['20140909',10.59,10.41,10.60,10.34,424199.00,-0.16,-0.02,10.57,0.00],['20140910',10.39,10.29,10.39,10.17,404452.00,-0.12,-0.01,10.41,0.00],['20140911',10.30,10.77,10.97,10.23,840563.00,0.48,0.05,10.29,0.00],['20140912',10.66,10.72,10.74,10.55,379531.00,-0.05,0.00,10.77,0.00],['20140915',10.66,10.70,10.84,10.65,295803.00,-0.02,0.00,10.72,0.00],['20140916',10.70,10.22,10.89,10.15,568271.00,-0.48,-0.04,10.70,0.00],['20140917',10.29,10.26,10.36,10.10,306657.00,0.04,0.00,10.22,0.00],['20140918',10.40,10.24,10.44,10.18,328858.00,-0.02,0.00,10.26,0.00],['20140919',10.19,10.25,10.32,10.17,376181.00,0.01,0.00,10.24,0.00],['20140922',10.24,9.88,10.24,9.86,423291.00,-0.37,-0.04,10.25,0.00],['20140923',9.90,10.01,10.08,9.89,244733.00,0.13,0.01,9.88,0.00],['20140924',10.02,10.24,10.25,9.96,325471.00,0.23,0.02,10.01,0.00],['20140925',10.31,10.22,10.41,10.18,380261.00,-0.02,0.00,10.24,0.00],['20140926',10.21,10.26,10.27,10.06,287649.00,0.04,0.00,10.22,0.00],['20140929',10.26,10.32,10.44,10.25,409366.00,0.06,0.01,10.26,0.00],['20140930',10.38,10.53,10.62,10.33,506866.00,0.21,0.02,10.32,0.00],['20141008',10.59,10.94,11.04,10.55,712319.00,0.41,0.04,10.53,0.00],['20141009',10.91,10.85,11.02,10.69,475003.00,-0.09,-0.01,10.94,0.00],['20141010',10.81,10.72,10.97,10.65,396673.00,-0.13,-0.01,10.85,0.00],['20141013',10.70,10.65,10.70,10.46,334845.00,-0.07,-0.01,10.72,0.00],['20141014',10.60,10.80,11.06,10.60,628240.00,0.15,0.01,10.65,0.00],['20141015',10.82,11.09,11.10,10.71,664504.00,0.29,0.03,10.80,0.00],['20141016',10.98,10.70,11.17,10.69,550573.00,-0.39,-0.04,11.09,0.00],['20141017',10.70,10.64,10.78,10.36,380505.00,-0.06,-0.01,10.70,0.00],['20141020',10.68,10.92,10.94,10.61,318981.00,0.28,0.03,10.64,0.00],['20141021',10.86,10.79,11.10,10.78,363676.00,-0.13,-0.01,10.92,0.00],['20141022',10.74,10.56,10.87,10.48,318351.00,-0.23,-0.02,10.79,0.00],['20141023',10.53,10.25,10.60,10.16,287459.00,-0.31,-0.03,10.56,0.00],['20141024',10.30,10.33,10.45,10.25,193102.00,0.08,0.01,10.25,0.00],['20141027',10.31,10.30,10.46,10.25,167073.00,-0.03,0.00,10.33,0.00],['20141028',10.36,10.68,10.76,10.31,406663.00,0.38,0.04,10.30,0.00],['20141029',10.75,10.95,11.13,10.72,705634.00,0.27,0.03,10.68,0.00],['20141030',10.90,11.04,11.10,10.83,630544.00,0.09,0.01,10.95,0.00],['20141031',11.07,11.13,11.47,11.07,963611.00,0.09,0.01,11.04,0.00],['20141103',11.26,11.12,11.35,11.05,485600.00,-0.01,0.00,11.13,0.00],['20141104',11.13,11.41,11.48,10.88,835667.00,0.29,0.03,11.12,0.00],['20141105',11.41,11.42,11.61,11.24,702522.00,0.01,0.00,11.41,0.00],['20141106',11.38,11.41,11.50,11.26,362115.00,-0.01,0.00,11.42,0.00],['20141107',11.42,11.11,11.51,11.08,477803.00,-0.30,-0.03,11.41,0.00],['20141110',11.14,11.22,11.30,11.07,301567.00,0.11,0.01,11.11,0.00],['20141111',11.25,10.92,11.27,10.74,526997.00,-0.30,-0.03,11.22,0.00],['20141112',10.88,11.04,11.12,10.84,245899.00,0.12,0.01,10.92,0.00],['20141113',11.06,10.98,11.09,10.83,273921.00,-0.06,-0.01,11.04,0.00],['20141114',10.94,11.79,12.00,10.87,1034580.00,0.81,0.07,10.98,0.00],['20141117',11.69,11.95,12.26,11.57,999048.00,0.16,0.01,11.79,0.00],['20141118',11.88,11.90,12.09,11.82,442575.00,-0.05,0.00,11.95,0.00],['20141119',11.90,12.64,13.00,11.83,1381886.00,0.74,0.06,11.90,0.00],['20141120',12.50,12.54,12.75,12.37,699649.00,-0.10,-0.01,12.64,0.00],['20141121',12.54,12.63,12.70,12.31,686881.00,0.09,0.01,12.54,0.00],['20141124',12.80,12.75,12.95,12.41,1177025.00,0.12,0.01,12.63,0.00],['20141125',12.75,12.70,12.85,12.50,804500.00,-0.05,0.00,12.75,0.00],['20141126',12.78,12.61,13.18,12.49,942242.00,-0.09,-0.01,12.70,0.00],['20141127',12.55,12.35,12.66,12.10,883041.00,-0.26,-0.02,12.61,0.00],['20141128',12.22,12.44,12.58,12.15,706467.00,0.09,0.01,12.35,0.00],['20141201',12.41,12.04,12.42,11.96,694356.00,-0.40,-0.03,12.44,0.00],['20141202',12.04,12.38,12.46,12.00,686691.00,0.34,0.03,12.04,0.00],['20141203',12.42,13.00,13.08,12.11,1230020.00,0.62,0.05,12.38,0.00],['20141204',13.05,13.07,13.19,12.76,955837.00,0.07,0.01,13.00,0.00],['20141205',13.06,12.54,13.07,12.21,923087.00,-0.53,-0.04,13.07,0.00],['20141208',12.50,13.10,13.50,12.27,1145207.00,0.56,0.04,12.54,0.00],['20141209',13.00,12.35,13.40,12.28,1146281.00,-0.75,-0.06,13.10,0.00],['20141210',12.34,12.63,12.74,12.27,580917.00,0.28,0.02,12.35,0.00],['20141211',12.51,12.93,12.97,12.34,821048.00,0.30,0.02,12.63,0.00],['20141212',12.91,13.77,13.94,12.89,1483915.00,0.84,0.06,12.93,0.00],['20141215',13.77,13.87,14.02,13.44,955783.00,0.10,0.01,13.77,0.00],['20141216',13.84,13.60,13.85,13.46,638399.00,-0.27,-0.02,13.87,0.00],['20141217',13.51,13.41,13.98,13.15,840732.00,-0.19,-0.01,13.60,0.00],['20141218',13.85,13.68,14.28,13.62,975099.00,0.27,0.02,13.41,0.00],['20141219',13.60,13.41,13.96,13.08,795616.00,-0.27,-0.02,13.68,0.00],['20141222',13.35,12.09,13.35,12.08,1048200.00,-1.32,-0.10,13.41,0.00],['20141223',12.09,11.79,12.36,11.72,718168.00,-0.30,-0.02,12.09,0.00],['20141224',11.83,12.20,12.28,11.72,552485.00,0.41,0.03,11.79,0.00],['20141225',12.20,12.22,12.27,11.99,480602.00,0.02,0.00,12.20,0.00],['20141226',12.27,12.28,12.37,12.03,606407.00,0.06,0.00,12.22,0.00],['20141229',12.40,12.19,12.72,12.10,705896.00,-0.09,-0.01,12.28,0.00],['20141230',12.21,11.32,12.25,11.27,922649.00,-0.87,-0.07,12.19,0.00],['20141231',11.35,11.68,11.76,11.06,611390.00,0.36,0.03,11.32,0.00],['20150105',11.69,12.04,12.19,11.48,668266.00,0.36,0.03,11.68,0.00],['20150106',11.87,12.09,12.24,11.70,589657.00,0.05,0.00,12.04,0.00],['20150107',12.06,11.77,12.06,11.56,567753.00,-0.32,-0.03,12.09,0.00],['20150108',11.78,11.90,12.03,11.62,591292.00,0.13,0.01,11.77,0.00],['20150109',11.98,11.83,12.35,11.80,766940.00,-0.07,-0.01,11.90,0.00],['20150112',11.69,11.61,11.78,11.42,476658.00,-0.22,-0.02,11.83,0.00],['20150113',11.65,12.13,12.33,11.52,981721.00,0.52,0.04,11.61,0.00],['20150114',12.14,12.34,12.64,11.97,937126.00,0.21,0.02,12.13,0.00],['20150115',12.37,12.43,12.66,12.25,629191.00,0.09,0.01,12.34,0.00],['20150116',12.50,12.95,13.22,12.47,1044218.00,0.52,0.04,12.43,0.00],['20150119',12.50,12.26,13.11,11.78,970260.00,-0.69,-0.05,12.95,0.00],['20150120',12.45,13.49,13.49,12.31,2594364.00,1.23,0.10,12.26,0.00],['20150121',13.54,13.83,13.84,13.36,2072893.00,0.34,0.03,13.49,0.00],['20150122',13.66,13.72,13.85,13.47,1157368.00,-0.11,-0.01,13.83,0.00],['20150123',13.95,13.43,14.35,13.35,1313869.00,-0.29,-0.02,13.72,0.00],['20150126',13.53,14.36,14.67,13.52,1657172.00,0.93,0.07,13.43,0.00],['20150127',14.35,14.54,14.88,14.02,1463526.00,0.18,0.01,14.36,0.00],['20150128',14.36,13.92,14.55,13.85,1066635.00,-0.62,-0.04,14.54,0.00],['20150129',13.75,14.03,14.29,13.70,710083.00,0.11,0.01,13.92,0.00],['20150130',14.12,13.32,14.27,13.29,927921.00,-0.71,-0.05,14.03,0.00],['20150202',13.00,13.41,13.57,12.90,539091.00,0.09,0.01,13.32,0.00],['20150203',13.55,13.79,14.06,13.41,778537.00,0.38,0.03,13.41,0.00],['20150204',13.79,13.81,14.18,13.66,699329.00,0.02,0.00,13.79,0.00],['20150205',13.93,14.19,15.03,13.70,1810444.00,0.38,0.03,13.81,0.00],['20150206',14.30,13.83,14.42,13.68,801409.00,-0.36,-0.03,14.19,0.00],['20150209',13.77,13.97,14.44,13.77,672000.00,0.14,1.01,13.83,0.00],['20150210',13.90,14.65,14.67,13.81,907096.00,0.68,4.87,13.97,0.00],['20150211',14.67,14.70,14.95,14.41,855543.00,0.05,0.34,14.65,0.00],['20150212',14.72,14.84,15.24,14.64,902914.00,0.14,0.95,14.70,0.00],['20150213',14.85,14.79,15.18,14.70,798354.00,-0.05,-0.34,14.84,0.00],['20150216',14.85,15.42,15.45,14.73,1128039.00,0.63,4.26,14.79,0.00],['20150217',15.38,15.08,15.50,15.06,741828.00,-0.34,-2.20,15.42,0.00],['20150225',15.02,14.61,15.12,14.42,766247.00,-0.47,-3.12,15.08,0.00],['20150226',14.60,14.81,14.83,14.53,499978.00,0.20,1.37,14.61,0.00],['20150227',14.76,15.08,15.25,14.74,694671.00,0.27,1.82,14.81,0.00],['20150302',15.13,15.21,15.40,15.06,716756.00,0.13,0.86,15.08,0.00],['20150303',14.99,14.62,14.99,14.54,1020177.00,-0.59,-3.88,15.21,0.00],['20150304',14.57,14.70,14.85,14.49,571622.00,0.08,0.55,14.62,0.00],['20150305',14.65,14.29,14.66,14.06,806632.00,-0.41,-2.79,14.70,0.00],['20150306',14.30,14.08,14.40,14.00,505286.00,-0.21,-1.47,14.29,0.00],['20150309',14.13,14.33,14.34,13.81,479627.00,0.25,1.78,14.08,0.00],['20150310',14.33,14.33,14.55,14.27,446553.00,0.00,0.00,14.33,0.00],['20150311',14.34,14.18,14.53,14.10,400713.00,-0.15,-1.05,14.33,0.00],['20150312',14.30,14.20,14.40,14.12,437357.00,0.02,0.14,14.18,0.00],['20150313',14.22,14.44,14.46,14.18,453654.00,0.24,1.69,14.20,0.00],['20150316',14.64,15.02,15.12,14.50,1030143.00,0.58,4.02,14.44,0.00],['20150317',15.10,15.25,15.45,14.93,1161717.00,0.23,1.53,15.02,0.00],['20150318',15.20,15.50,15.65,15.10,1047717.00,0.25,1.64,15.25,0.00],['20150319',15.92,15.64,16.28,15.50,1321050.00,0.14,0.90,15.50,0.00],['20150320',15.55,15.73,16.15,15.38,1002090.00,0.09,0.58,15.64,0.00],['20150323',15.73,16.47,16.65,15.73,1384076.00,0.74,4.70,15.73,0.00],['20150324',17.01,16.84,17.27,16.02,1819797.00,0.37,2.25,16.47,0.00],['20150325',16.86,16.57,17.11,16.38,1027933.00,-0.27,-1.60,16.84,0.00],['20150326',16.40,16.00,16.46,15.94,904105.00,-0.57,-3.44,16.57,0.00],['20150327',16.00,16.17,16.28,15.91,553217.00,0.17,1.06,16.00,0.00],['20150330',16.16,16.38,16.48,16.11,747450.00,0.21,1.30,16.17,0.00],['20150331',16.47,16.41,16.84,16.31,879930.00,0.03,0.18,16.38,0.00],['20150401',16.42,16.95,17.12,16.30,968480.00,0.54,3.29,16.41,0.00],['20150402',17.30,16.83,17.33,16.51,950261.00,-0.12,-0.71,16.95,0.00],['20150403',16.71,17.08,17.29,16.60,910027.00,0.25,1.49,16.83,0.00],['20150407',17.20,17.60,17.90,17.06,1161213.00,0.52,3.04,17.08,0.00],['20150408',17.55,16.93,17.70,16.71,1107613.00,-0.67,-3.81,17.60,0.00],['20150409',16.88,16.48,17.05,15.81,1065937.00,-0.45,-2.66,16.93,0.00],['20150410',16.49,17.59,17.90,16.40,1461764.00,1.11,6.74,16.48,0.00],['20150413',17.60,18.86,19.35,17.45,1735184.00,1.27,7.22,17.59,0.00],['20150414',18.50,18.33,18.80,17.98,1138917.00,-0.53,-2.81,18.86,0.00],['20150415',18.29,17.52,18.29,17.50,753903.00,-0.81,-4.42,18.33,0.00],['20150416',17.49,18.31,18.47,17.32,812922.00,0.79,4.51,17.52,0.00],['20150417',18.31,18.26,18.65,17.90,917633.00,-0.05,-0.27,18.31,0.00],['20150420',18.00,17.16,18.00,17.05,1175369.00,-1.10,-6.02,18.26,0.00],['20150421',17.18,17.85,17.99,17.18,794872.00,0.69,4.02,17.16,0.00],['20150422',17.90,18.25,18.55,17.90,949184.00,0.40,2.24,17.85,0.00],['20150423',18.47,18.16,18.48,17.78,776081.00,-0.09,-0.49,18.25,0.00],['20150424',17.91,19.97,19.98,17.80,1866254.00,1.81,9.97,18.16,0.00],['20150427',20.00,19.98,20.41,19.53,1666707.00,0.01,0.05,19.97,0.00],['20150428',19.80,18.88,19.95,18.68,1045852.00,-1.10,-5.51,19.98,0.00],['20150429',18.94,20.77,20.77,18.91,1222122.00,1.89,10.01,18.88,0.00],['20150430',21.00,20.42,21.90,20.35,1724820.00,-0.35,-1.69,20.77,0.00],['20150504',20.43,20.40,20.97,19.70,907383.00,-0.02,-0.10,20.42,0.00],['20150505',20.48,19.74,20.60,19.48,815981.00,-0.66,-3.24,20.40,0.00],['20150506',20.00,20.24,21.20,19.90,1173277.00,0.50,2.53,19.74,0.00],['20150507',19.89,19.75,20.18,19.50,767559.00,-0.49,-2.42,20.24,0.00],['20150508',20.22,20.75,20.85,20.01,1133648.00,1.00,5.06,19.75,0.00],['20150511',20.95,22.42,22.50,20.50,1559674.00,1.67,8.05,20.75,0.00],['20150512',22.23,22.03,22.54,21.55,1174732.00,-0.39,-1.74,22.42,0.00],['20150513',22.00,22.77,23.47,21.64,1236575.00,0.70,3.17,22.07,0.00],['20150514',22.88,23.17,23.26,22.31,889570.00,0.40,1.76,22.77,0.00],['20150515',23.00,22.06,23.00,22.00,963381.00,-1.11,-4.79,23.17,0.00],['20150518',21.85,21.89,22.59,21.70,771905.00,-0.17,-0.77,22.06,0.00],['20150519',22.19,23.01,23.08,21.86,862655.00,1.12,5.12,21.89,0.00],['20150520',23.30,22.83,24.20,22.70,1168519.00,-0.18,-0.78,23.01,0.00],['20150521',22.82,24.00,24.20,22.75,1048576.00,1.17,5.12,22.83,0.00],['20150522',24.60,23.97,24.80,23.23,1121639.00,-0.03,-0.13,24.00,0.00],['20150525',23.73,24.28,24.67,23.51,1014246.00,0.31,1.29,23.97,0.00],['20150526',26.00,26.71,26.71,25.41,626653.00,2.43,10.01,24.28,0.00],['20150527',29.20,29.38,29.38,28.50,1925625.00,2.67,10.00,26.71,0.00],['20150528',30.00,27.31,30.37,27.02,2319152.00,-2.07,-7.05,29.38,0.00],['20150529',27.98,28.78,29.80,27.00,1940127.00,1.47,5.38,27.31,0.00],['20150601',28.77,31.66,31.66,28.38,1203721.00,2.88,10.01,28.78,0.00],['20150602',33.20,32.56,34.18,31.51,1785699.00,0.90,2.84,31.66,0.00],['20150603',32.40,31.74,32.62,30.81,1215092.00,-0.82,-2.52,32.56,0.00],['20150604',32.00,30.78,32.62,28.57,1532864.00,-0.96,-3.02,31.74,0.00],['20150605',31.50,30.14,31.65,29.35,1233233.00,-0.64,-2.08,30.78,0.00],['20150608',30.09,29.60,30.10,28.33,1214050.00,-0.54,-1.79,30.14,0.00],['20150609',29.40,30.72,31.59,28.89,1110165.00,1.12,3.78,29.60,0.00],['20150610',30.45,31.25,32.00,30.00,1181797.00,0.53,1.73,30.72,0.00],['20150611',31.29,30.40,31.48,30.00,880273.00,-0.85,-2.72,31.25,0.00],['20150612',30.47,30.45,31.50,30.40,864825.00,0.05,0.16,30.40,0.00],['20150615',30.49,29.02,30.70,28.82,928609.00,-1.43,-4.70,30.45,0.00],['20150616',28.70,28.57,29.57,28.10,756068.00,-0.45,-1.55,29.02,0.00],['20150617',29.45,29.19,29.59,27.78,714112.00,0.62,2.17,28.57,0.00],['20150618',29.19,27.94,29.67,27.88,592093.00,-1.25,-4.28,29.19,0.00],['20150619',27.40,25.15,27.48,25.15,799468.00,-2.79,-9.99,27.94,0.00],['20150623',25.02,23.86,25.24,22.64,1413369.00,-1.29,-5.13,25.15,0.00],['20150624',24.18,24.68,25.28,23.80,1030754.00,0.82,3.44,23.86,0.00],['20150625',24.81,24.68,25.95,24.01,1045355.00,0.00,0.00,24.68,0.00],['20150626',23.90,22.21,24.16,22.21,898990.00,-2.47,-10.01,24.68,0.00],['20150629',23.00,19.99,23.00,19.99,1144795.00,-2.22,-10.00,22.21,0.00],['20150630',19.46,20.99,21.28,17.99,1519491.00,1.00,5.00,19.99,0.00],['20150701',20.40,19.43,21.80,19.00,1272242.00,-1.56,-7.43,20.99,0.00],['20150702',19.70,17.49,20.00,17.49,1082349.00,-1.94,-9.98,19.43,0.00],['20150703',16.86,15.74,17.88,15.74,1309914.00,-1.75,-10.01,17.49,0.00],['20150706',17.31,14.18,17.31,14.17,2181688.00,-1.56,-9.91,15.74,0.00],['20150707',13.65,12.76,14.09,12.76,2497903.00,-1.42,-10.01,14.18,0.00],['20150708',11.48,11.48,12.08,11.48,2027578.00,-1.28,-10.03,12.76,0.00],['20150709',11.65,12.63,12.63,11.58,1552485.00,1.15,10.02,11.48,0.00],['20150710',13.89,13.89,13.89,13.89,295018.00,1.26,9.98,12.63,0.00],['20150713',15.28,15.28,15.28,15.28,231152.00,1.39,10.01,13.89,0.00],['20150714',16.81,16.81,16.81,16.81,123891.00,1.53,10.01,15.28,0.00],['20150715',17.69,16.81,18.28,16.61,4804177.00,0.00,0.00,16.81,0.00],['20150716',15.68,18.49,18.49,15.29,3356711.00,1.68,9.99,16.81,0.00],['20150717',18.60,19.30,20.10,18.18,2748091.00,0.89,4.83,18.41,0.00],['20150720',18.99,19.56,20.39,18.81,2404099.00,0.26,1.35,19.30,0.00],['20150721',19.00,19.43,20.00,18.79,1695592.00,-0.13,-0.66,19.56,0.00],['20150722',19.35,21.07,21.36,19.35,2342706.00,1.64,8.44,19.43,0.00],['20150723',20.85,21.28,21.93,20.26,2098030.00,0.21,1.00,21.07,0.00],['20150724',21.35,20.38,21.80,20.00,1883688.00,-0.90,-4.23,21.28,0.00],['20150727',19.90,18.35,21.28,18.34,2163585.00,-2.03,-9.96,20.38,0.00],['20150728',17.43,19.67,20.19,17.31,3044276.00,1.32,7.19,18.35,0.00],['20150729',19.80,20.61,20.90,18.11,2599858.00,0.94,4.78,19.67,0.00],['20150730',20.01,20.04,21.47,19.94,2342329.00,-0.57,-2.77,20.61,0.00],['20150731',19.60,18.97,20.15,18.37,1566867.00,-1.07,-5.34,20.04,0.00],['20150803',18.40,17.07,18.80,17.07,1467261.00,-1.90,-10.02,18.97,0.00],['20150804',17.34,18.78,18.78,17.22,1504454.00,1.71,10.02,17.07,0.00],['20150805',18.85,18.46,19.28,18.05,1465707.00,-0.32,-1.70,18.78,0.00],['20150806',17.90,18.50,19.10,17.70,1151693.00,0.04,0.22,18.46,0.00],['20150807',18.85,19.43,19.68,18.72,1491271.00,0.93,5.03,18.50,0.00],['20150810',19.86,20.61,20.99,19.45,1690403.00,1.18,6.07,19.43,0.00],['20150811',20.57,20.23,20.69,19.98,1491176.00,-0.38,-1.84,20.61,0.00],['20150812',19.86,19.87,20.77,19.80,1186264.00,-0.36,-1.78,20.23,0.00],['20150813',20.00,20.76,20.80,19.31,1417825.00,0.89,4.48,19.87,0.00],['20150814',20.99,20.52,21.55,20.50,1608045.00,-0.24,-1.16,20.76,0.00],['20150817',20.50,21.24,21.28,19.90,1455542.00,0.72,3.51,20.52,0.00],['20150818',21.18,19.12,21.18,19.12,1603327.00,-2.12,-9.98,21.24,0.00],['20150819',18.32,19.22,19.55,17.51,1367660.00,0.10,0.52,19.12,0.00],['20150820',18.90,19.95,21.14,18.65,2954053.00,0.73,3.80,19.22,0.00],['20150821',19.27,18.03,19.35,17.96,2077509.00,-1.92,-9.62,19.95,0.00],['20150824',16.91,16.23,17.28,16.23,1082858.00,-1.80,-9.98,18.03,0.00],['20150825',14.61,14.61,15.18,14.61,955707.00,-1.62,-9.98,16.23,0.00],['20150826',14.50,13.15,15.37,13.15,1661474.00,-1.46,-9.99,14.61,0.00],['20150827',13.80,14.33,14.35,13.07,1432189.00,1.18,8.97,13.15,0.00],['20150828',14.59,15.76,15.76,14.30,1644654.00,1.43,9.98,14.33,0.00],['20150831',15.55,15.17,15.70,14.65,1406290.00,-0.59,-3.74,15.76,0.00],['20150901',14.89,14.20,14.98,13.77,1212511.00,-0.97,-6.39,15.17,0.00],['20150902',13.28,13.99,14.80,13.01,1337156.00,-0.21,-1.48,14.20,0.00],['20150907',14.49,14.53,15.35,14.33,1053481.00,0.54,3.86,13.99,0.00],['20150908',14.50,15.50,15.65,14.04,962165.00,0.97,6.68,14.53,0.00],['20150909',15.60,15.97,16.26,15.38,1339990.00,0.47,3.03,15.50,0.00],['20150910',15.63,15.35,15.88,15.30,756675.00,-0.62,-3.88,15.97,0.00],['20150911',15.43,15.86,16.28,15.38,998616.00,0.51,3.32,15.35,0.00],['20150914',15.88,14.28,15.91,14.27,1176635.00,-1.58,-9.96,15.86,0.00],['20150915',13.95,12.91,14.34,12.85,866156.00,-1.37,-9.59,14.28,0.00],['20150916',13.00,14.20,14.20,13.00,1001803.00,1.29,9.99,12.91,0.00],['20150917',14.30,14.10,15.14,14.04,1336552.00,-0.10,-0.70,14.20,0.00],['20150918',14.40,15.02,15.35,14.30,1237178.00,0.92,6.52,14.10,0.00],['20150921',14.50,15.54,15.67,14.34,1183578.00,0.52,3.46,15.02,0.00],['20150922',15.56,15.49,15.84,15.03,1053799.00,-0.05,-0.32,15.54,0.00],['20150923',15.10,15.26,15.63,14.99,860825.00,-0.23,-1.48,15.49,0.00],['20150924',15.34,15.58,15.76,15.16,875724.00,0.32,2.10,15.26,0.00],['20150925',15.49,14.38,15.56,14.18,838092.00,-1.20,-7.70,15.58,0.00],['20150928',14.50,14.88,14.97,14.30,588207.00,0.50,3.48,14.38,0.00],['20150929',14.55,14.30,14.63,14.03,486260.00,-0.58,-3.90,14.88,0.00],['20150930',14.40,14.38,14.66,14.21,382404.00,0.08,0.56,14.30,0.00],['20151008',15.00,15.41,15.78,14.92,619639.00,1.03,7.16,14.38,0.00],['20151009',15.27,15.60,15.99,15.19,859718.00,0.39,2.56,15.21,0.00],['20151026',17.16,17.16,17.16,17.16,370129.00,1.56,10.00,15.60,0.00],['20151027',17.15,18.18,18.49,17.00,2084580.00,1.02,5.94,17.16,0.00],['20151028',17.75,17.19,17.99,17.06,1103584.00,-0.99,-5.45,18.18,0.00],['20151029',17.55,17.30,17.63,17.16,646957.00,0.11,0.64,17.19,0.00],['20151030',17.10,17.04,17.58,16.55,749717.00,-0.26,-1.50,17.30,0.00],['20151102',16.30,16.14,17.09,16.10,732359.00,-0.90,-5.28,17.04,0.00],['20151103',16.71,16.43,16.89,16.25,583100.00,0.29,1.80,16.14,0.00],['20151104',16.63,17.66,17.68,16.52,1041025.00,1.23,7.49,16.43,0.00],['20151105',17.66,17.68,18.25,17.38,1549578.00,0.02,0.11,17.66,0.00],['20151106',18.50,18.36,18.84,18.06,1594625.00,0.68,3.85,17.68,0.00],['20151109',18.83,18.51,19.38,18.38,1659941.00,0.15,0.82,18.36,0.00],['20151110',18.29,18.07,18.52,18.00,1241699.00,-0.44,-2.38,18.51,0.00],['20151111',18.37,18.61,18.80,18.18,1226400.00,0.54,2.99,18.07,0.00],['20151112',18.63,18.19,18.68,17.90,1057420.00,-0.42,-2.26,18.61,0.00],['20151113',17.90,18.81,19.18,17.62,1488664.00,0.62,3.41,18.19,0.00],['20151116',18.99,20.03,20.59,18.83,1902967.00,1.22,6.49,18.81,0.00],['20151117',19.98,19.38,20.05,19.23,1583788.00,-0.65,-3.25,20.03,0.00],['20151118',19.50,18.75,19.80,18.58,976427.00,-0.63,-3.25,19.38,0.00]];
15 |
16 | var Component = React.createClass({
17 | getPriceData:function(code,cycle){
18 | var me=this;
19 | var kdata = [];
20 | var c1 = 5,c2=10,c3=20,c4=60;
21 | function _getAvg (c1, data, i) {
22 | var v = 0;
23 | if (i >= c1) {
24 | var n = 0;
25 | for (var j = 0; j < c1; j++) {
26 | n += data[i - j][2];
27 | }
28 | v = n / c1;
29 | return v;
30 | } else {
31 | return data[i][2];
32 | }
33 | }
34 | dayData.forEach(function (e,i) {
35 | kdata.push([
36 | e[0],
37 | e[1],//开盘
38 | e[2],//收盘
39 | e[3],//最高
40 | e[4],//最低
41 | e[5],//成交量
42 | (e[6]||0),//涨跌额
43 | (e[7]||0),//涨跌幅
44 | _getAvg(c1, dayData, i),//移动平均线1
45 | _getAvg(c2, dayData, i),//移动平均线2
46 | _getAvg(c3, dayData, i),//移动平均线3
47 | _getAvg(c4, dayData, i)//移动平均线4
48 | ]);
49 | });
50 | return kdata;
51 | },
52 | getCandleData:function (argument) {
53 | var kdata={
54 | data:this.getPriceData().slice(80,200),
55 | label:"",
56 | config:{
57 | visbleRange:[0,50],
58 | color:'WHITE',
59 | shadowColor:"GRAY",
60 | shadowWidth:1,
61 | decreasingColor:'#006030',
62 | decreasingPaintStyle:"FILL",
63 | increasingColor:'#A50B31',
64 | increasingPaintStyle:"FILL"
65 | }
66 | }
67 | return kdata;
68 | },
69 | getAvgData:function (argument) {
70 | var avgData={
71 | xValues:[],
72 | yValues:[
73 | {
74 | data:[],
75 | label:"5",
76 | config:{
77 | drawCircles:false,
78 | color:'#FF0080'
79 | }
80 | },
81 | {
82 | data:[],
83 | label:"10",
84 | config:{
85 | drawCircles:false,
86 | color:'#E1E100'
87 | }
88 | },
89 | {
90 | data:[],
91 | label:"20",
92 | config:{
93 | drawCircles:false,
94 | color:'#3D7878'
95 | }
96 | },
97 | {
98 | data:[],
99 | label:"60",
100 | config:{
101 | drawCircles:false,
102 | color:'#FF8000'
103 | }
104 | }
105 | ]
106 | }
107 | var allData=this.getPriceData().slice(80,200);
108 | for (var i = 0; i < allData.length; i++) {
109 |
110 | allData[i][0]=allData[i][0].substring(4);
111 | avgData.xValues.push(allData[i][0]);
112 | avgData.yValues[0].data.push(allData[i][8]);
113 | avgData.yValues[1].data.push(allData[i][9]);
114 | avgData.yValues[2].data.push(allData[i][10]);
115 | avgData.yValues[3].data.push(allData[i][11]);
116 | };
117 | return avgData;
118 | },
119 | render: function() {
120 | return (
121 |
122 |
123 |
124 |
136 |
137 |
138 |
139 |
140 |
141 |
142 | );
143 | }
144 | });
145 |
146 | var styles = StyleSheet.create({
147 | container:{
148 | flex:1
149 | },
150 | chartContainer:{
151 | flex:1
152 | },
153 | chart:{
154 | flex:1
155 | }
156 | });
157 |
158 |
159 | module.exports = Component;
160 |
--------------------------------------------------------------------------------
/sample/CombinedChart.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 | var TitleBar=require('./TitleBar');
6 | var {
7 | CombinedChart
8 | }=require('../index.android');
9 | var {
10 | StyleSheet,
11 | View,
12 | Text
13 | } = React;
14 |
15 | var Component = React.createClass({
16 | getData:function (argument) {
17 | var data={
18 | xValues:['1','2','3'],
19 | yValues:[
20 | {
21 | data:[4.0,5.0,6.0],
22 | label:'test1',
23 | config:{
24 | color:'blue'
25 | }
26 | }
27 | ]
28 | };
29 | return data;
30 | },
31 | getRandomData:function (argument) {
32 | var data={};
33 | data['xValues']=[];
34 | data['yValues']=[
35 | {
36 | data:[],
37 | label:'test1',
38 | config:{
39 | color:'blue'
40 | }
41 | }
42 | ];
43 | for (var i = 0; i < 500; i++) {
44 | data.xValues.push(i+'');
45 | data.yValues[0].data.push(Math.random()*100);
46 | };
47 | return data;
48 | },
49 | render: function() {
50 | return (
51 |
52 |
53 |
54 |
66 |
67 |
68 |
69 |
70 |
71 | );
72 | }
73 | });
74 |
75 | var styles = StyleSheet.create({
76 | container:{
77 | flex:1
78 | },
79 | chartContainer:{
80 | flex:1
81 | },
82 | chart:{
83 | flex:1
84 | }
85 | });
86 |
87 |
88 | module.exports = Component;
89 |
--------------------------------------------------------------------------------
/sample/Index.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 | var BarChart=require('./BarChart');
6 | var LineChart=require('./LineChart');
7 | var CandleChart=require('./CandleChart');
8 | var CombinedChart=require('./CombinedChart');
9 | var Button=require('./Button');
10 | var {
11 | StyleSheet,
12 | View,
13 | TouchableOpacity,
14 | Text,
15 | Navigator,
16 | NativeAppEventEmitter
17 | } = React;
18 |
19 |
20 |
21 |
22 | var Component = React.createClass({
23 | onBack:function (argument) {
24 | this._nav.pop();
25 | },
26 | componentWillMount: function() {
27 | var me=this;
28 | NativeAppEventEmitter.addListener('back', this.onBack);
29 | },
30 | renderScene:function (route, navigator) {
31 | switch(route.name){
32 | case "main":
33 | return(
34 |
35 |
40 | );
41 | break;
42 | case "bar":
43 | return ()
44 | break;
45 | case "line":
46 | return ()
47 | break;
48 | case "candle":
49 | return ()
50 | break;
51 | case "combined":
52 | return ()
53 | break;
54 | }
55 | },
56 | bindSelect:function (name) {
57 | var me=this;
58 | return function(){
59 | me.onSelect(name);
60 | };
61 | },
62 | onSelect:function (name) {
63 | this._nav.push({name:name})
64 | },
65 | render: function() {
66 | return (
67 | this._nav=n}
69 | debugOverlay={false}
70 | style={{flex:1}}
71 | configureScene={(route) =>Navigator.SceneConfigs.PushFromRight}
72 | initialRoute={{name:'main'}}
73 | renderScene={this.renderScene}/>
74 |
75 | );
76 | }
77 | });
78 |
79 |
80 | var styles = StyleSheet.create({
81 | container:{
82 | flex:1
83 | }
84 | });
85 |
86 |
87 | module.exports = Component;
88 |
--------------------------------------------------------------------------------
/sample/LineChart.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 | var TitleBar=require('./TitleBar');
6 | var {
7 | LineChart
8 | }=require('../index.android');
9 | var {
10 | StyleSheet,
11 | View,
12 | Text
13 | } = React;
14 |
15 | var Component = React.createClass({
16 | getLineData:function (argument) {
17 | var data={
18 | xValues:['1','2','3'],
19 | yValues:[
20 | {
21 | data:[1.0,5.0,6.0],
22 | label:'test1',
23 | config:{
24 | color:'blue'
25 | }
26 | },
27 | {
28 | data:[3.0,15.0,22],
29 | label:'test2',
30 | config:{
31 | color:'red'
32 | }
33 | },
34 | {
35 | data:[7,12,22],
36 | label:'test2',
37 | config:{
38 | color:'yellow'
39 | }
40 | }
41 | ]
42 | };
43 | return data;
44 | },
45 | getRandomData:function (argument) {
46 | var data={};
47 | data['xValues']=[];
48 | data['yValues']=[
49 | {
50 | data:[],
51 | label:'test1',
52 | config:{
53 | color:'blue'
54 | }
55 | }
56 | ];
57 | for (var i = 0; i < 500; i++) {
58 | data.xValues.push(i+'');
59 | data.yValues[0].data.push(Math.random()*100);
60 | };
61 | return data;
62 | },
63 | render: function() {
64 | return (
65 |
66 |
67 |
68 |
69 |
82 |
83 |
84 | );
85 | }
86 | });
87 |
88 | var styles = StyleSheet.create({
89 | container:{
90 | flex:1
91 | },
92 | chartContainer:{
93 | flex:1
94 | },
95 | chart:{
96 | flex:1
97 | }
98 | });
99 |
100 |
101 | module.exports = Component;
102 |
--------------------------------------------------------------------------------
/sample/RadarChart.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 | var TitleBar=require('./TitleBar');
6 | var {
7 | BarChart,
8 | CombinedChart
9 | }=require('../index.android');
10 | var {
11 | StyleSheet,
12 | View,
13 | Text
14 | } = React;
15 |
16 | var Component = React.createClass({
17 | getRadarData:function (argument) {
18 | var radarData={
19 | name:'2016-11-4',
20 | data:[0.5,0.6,0.7,0.4,0.55],
21 | parties:['Sugar','Carl','Vitamin','Water','Others'],
22 | };
23 | return radarData;
24 | },
25 | render: function() {
26 | return (
27 |
28 |
29 |
34 |
35 |
36 | );
37 | }
38 | });
39 |
40 | var styles = StyleSheet.create({
41 | container:{
42 | flex:1
43 | },
44 | chartContainer:{
45 | flex:1
46 | },
47 | chart:{
48 | flex:1
49 | }
50 | });
51 |
52 | module.exports = Component;
53 |
--------------------------------------------------------------------------------
/sample/TitleBar.js:
--------------------------------------------------------------------------------
1 | /* @flow */
2 | 'use strict';
3 |
4 | var React = require('react-native');
5 | var Button=require('./Button');
6 | var {
7 | StyleSheet,
8 | View,
9 | NativeAppEventEmitter
10 | } = React;
11 |
12 | var Component = React.createClass({
13 | onBack:function (argument) {
14 | NativeAppEventEmitter.emit('back');
15 | },
16 | render: function() {
17 | return (
18 |
19 |
20 |
21 | );
22 | }
23 | });
24 |
25 |
26 | var styles = StyleSheet.create({
27 | container:{
28 | height:50,
29 | justifyContent:'flex-start',
30 | borderBottomWidth:1,
31 | borderBottomColor:'#e5e5e5'
32 | },
33 | button:{
34 | width:80
35 | }
36 | });
37 |
38 |
39 | module.exports = Component;
40 |
--------------------------------------------------------------------------------
/sample/chart1.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hongyin163/react-native-chart-android/eeba3aced601eafe34bad33f784ea55bf81f0fa6/sample/chart1.JPG
--------------------------------------------------------------------------------
/sample/chart2.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hongyin163/react-native-chart-android/eeba3aced601eafe34bad33f784ea55bf81f0fa6/sample/chart2.JPG
--------------------------------------------------------------------------------