Skip to content

Commit

Permalink
Merge pull request #30 from mijia/master
Browse files Browse the repository at this point in the history
Support line chart data at index to show image with line segments
  • Loading branch information
hongyin163 authored Jul 5, 2016
2 parents 572c134 + 3197451 commit 220d0da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ private void setXAxisInfo(XAxis axis,ReadableMap v){
if(v.hasKey("labelRotationAngle")) axis.setLabelRotationAngle((float) v.getDouble("labelRotationAngle"));
if(v.hasKey("spaceBetweenLabels")) axis.setSpaceBetweenLabels(v.getInt("spaceBetweenLabels"));
if(v.hasKey("labelsToSkip")) axis.setLabelsToSkip(v.getInt("labelsToSkip"));
if(v.hasKey("avoidFirstLastClipping")) axis.setAvoidFirstLastClipping(v.getBoolean("avoidFirstLastClipping"));
if(v.hasKey("position")) {
String name=v.getString("position");
axis.setPosition(XAxis.XAxisPosition.valueOf(name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ public void setData(LineChart chart,ReadableMap rm){
float[] vals=new float[data.size()];
ArrayList<Entry> entries=new ArrayList<Entry>();
for (int j=0;j<data.size();j++){
vals[j]=(float)data.getDouble(j);
Entry be=new Entry((float)data.getDouble(j),j);
entries.add(be);
if (!data.isNull(j)) {
vals[j]=(float)data.getDouble(j);
Entry be=new Entry((float)data.getDouble(j),j);
entries.add(be);
}
}
/*BarEntry be=new BarEntry(vals,i);
entries.add(be);*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public void setHoleRadius(PieChart chart, float holeRadius){
}

@ReactProp(name="backgroundColor", defaultInt = Color.WHITE)
public void setBackgroundColor(){
public void setBackgroundColor(PieChart chart, int backgroundColor){
chart.setBackgroundColor(backgroundColor);
chart.invalidate();
chart.invalidate();
}

@ReactProp(name="drawSliceText", defaultBoolean = false)
public void setDrawSliceText(PieChart chart, boolean enabled){
chart.setDrawSliceText(enabled);
Expand Down

0 comments on commit 220d0da

Please sign in to comment.