Skip to content

Commit

Permalink
Merge pull request #63 from consenlabs/master
Browse files Browse the repository at this point in the history
Add axisDependency for dataSet
thanks
  • Loading branch information
hongyin163 authored Dec 9, 2016
2 parents 9036190 + 0dace0e commit fc45036
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 19 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.utils.ColorTemplate;
import com.github.mikephil.charting.components.YAxis.AxisDependency;

import java.util.ArrayList;
import java.util.Random;
Expand Down Expand Up @@ -83,7 +84,7 @@ public void setData(LineChart chart,ReadableMap rm){
if(config.hasKey("lineWidth")) dataSet.setLineWidth((float) config.getDouble("lineWidth"));
if(config.hasKey("drawValues")) dataSet.setDrawValues(config.getBoolean("drawValues"));
if(config.hasKey("valueTextColor")) dataSet.setValueTextColor(Color.parseColor(config.getString("valueTextColor")));

// Text Size for bar value

if(config.hasKey("valueTextSize")) dataSet.setValueTextSize((float)config.getDouble("valueTextSize"));
Expand Down Expand Up @@ -122,6 +123,13 @@ public void setData(LineChart chart,ReadableMap rm){
if (config.hasKey("fillColor")) dataSet.setFillColor(Color.parseColor(config.getString("fillColor")));
if (config.hasKey("fillAlpha")) dataSet.setFillAlpha((int)(255 * config.getDouble("fillAlpha")));
if (config.hasKey("bezier")) dataSet.setDrawCubic(config.getBoolean("bezier"));
if (config.hasKey("axisDependency")) {
AxisDependency axisDependency = AxisDependency.LEFT;
if (config.getString("axisDependency").equalsIgnoreCase("RIGHT")) {
axisDependency = AxisDependency.RIGHT;
}
dataSet.setAxisDependency(axisDependency);
}

chartData.addDataSet(dataSet);
}
Expand Down
17 changes: 0 additions & 17 deletions index.android.js

This file was deleted.

17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import BarChart from './BarChart';
import HorizontalBarChart from './HorizontalBarChart';
import LineChart from './LineChart';
import CandleStickChart from './CandleStickChart';
import CombinedChart from './CombinedChart';
import PieChart from './PieChart';
import RadarChart from './RadarChart';

export {
BarChart,
HorizontalBarChart,
LineChart,
CandleStickChart,
CombinedChart,
PieChart,
RadarChart
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-native-chart-android",
"version": "1.0.6",
"description": "react-native-mpchart provide modules to add chart to android,all charts are come from mpandroidchart library.",
"main": "index.android.js",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down

0 comments on commit fc45036

Please sign in to comment.