Skip to content

Commit a4214dd

Browse files
committed
Minor fixes, created new .jar file.
1 parent cee1021 commit a4214dd

File tree

5 files changed

+51
-53
lines changed

5 files changed

+51
-53
lines changed
1.21 MB
Binary file not shown.

MPChartExample/project.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@
1212

1313
# Project target.
1414
target=android-19
15-
android.library.reference.1=../MPChartLib

MPChartExample/src/com/xxmassdeveloper/mpchartexample/PieChartActivity.java

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -99,48 +99,6 @@ protected void onCreate(Bundle savedInstanceState) {
9999

100100
}
101101

102-
private void removeLastEntry() {
103-
104-
PieData data = mChart.getDataOriginal();
105-
106-
if (data != null) {
107-
108-
PieDataSet set = data.getDataSet();
109-
110-
if (set != null) {
111-
112-
Entry e = set.getEntryForXIndex(set.getEntryCount() - 1);
113-
114-
data.removeEntry(e, 0);
115-
// or remove by index
116-
// mData.removeEntry(xIndex, dataSetIndex);
117-
118-
mChart.notifyDataSetChanged();
119-
mChart.invalidate();
120-
}
121-
}
122-
}
123-
124-
private void addEntry() {
125-
126-
PieData data = mChart.getDataOriginal();
127-
128-
if(data != null) {
129-
130-
PieDataSet set = data.getDataSet();
131-
// set.addEntry(...);
132-
133-
data.addEntry(new Entry((float) (Math.random() * 25) + 20f,
134-
set.getEntryCount()), 0);
135-
136-
// let the chart know it's data has changed
137-
mChart.notifyDataSetChanged();
138-
139-
// redraw the chart
140-
mChart.invalidate();
141-
}
142-
}
143-
144102
@Override
145103
public boolean onCreateOptionsMenu(Menu menu) {
146104
getMenuInflater().inflate(R.menu.pie, menu);
@@ -297,4 +255,46 @@ public void onStopTrackingTouch(SeekBar seekBar) {
297255
// TODO Auto-generated method stub
298256

299257
}
258+
259+
// private void removeLastEntry() {
260+
//
261+
// PieData data = mChart.getDataOriginal();
262+
//
263+
// if (data != null) {
264+
//
265+
// PieDataSet set = data.getDataSet();
266+
//
267+
// if (set != null) {
268+
//
269+
// Entry e = set.getEntryForXIndex(set.getEntryCount() - 1);
270+
//
271+
// data.removeEntry(e, 0);
272+
// // or remove by index
273+
// // mData.removeEntry(xIndex, dataSetIndex);
274+
//
275+
// mChart.notifyDataSetChanged();
276+
// mChart.invalidate();
277+
// }
278+
// }
279+
// }
280+
//
281+
// private void addEntry() {
282+
//
283+
// PieData data = mChart.getDataOriginal();
284+
//
285+
// if (data != null) {
286+
//
287+
// PieDataSet set = data.getDataSet();
288+
// // set.addEntry(...);
289+
//
290+
// data.addEntry(new Entry((float) (Math.random() * 25) + 20f,
291+
// set.getEntryCount()), 0);
292+
//
293+
// // let the chart know it's data has changed
294+
// mChart.notifyDataSetChanged();
295+
//
296+
// // redraw the chart
297+
// mChart.invalidate();
298+
// }
299+
// }
300300
}

MPChartLib/src/com/github/mikephil/charting/charts/PieChart.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import com.github.mikephil.charting.data.Entry;
1616
import com.github.mikephil.charting.data.PieData;
1717
import com.github.mikephil.charting.data.PieDataSet;
18-
import com.github.mikephil.charting.utils.Legend.LegendPosition;
1918
import com.github.mikephil.charting.utils.Utils;
2019

2120
import java.util.ArrayList;

MPChartLib/src/com/github/mikephil/charting/charts/PieRadarChartBase.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected void calculateOffsets() {
146146
mOffsetLeft = Math.max(min, getRequiredBaseOffset());
147147
mOffsetTop = Math.max(min, legendTop);
148148
mOffsetRight = Math.max(min, legendRight);
149-
mOffsetBottom = Math.max(min, legendBottom);
149+
mOffsetBottom = Math.max(min, Math.max(getRequiredBaseOffset(), legendBottom));
150150

151151
applyCalculatedOffsets();
152152
}
@@ -372,6 +372,14 @@ public float getDiameter() {
372372
* @return
373373
*/
374374
protected abstract float getRequiredBottomOffset();
375+
376+
/**
377+
* Returns the base offset needed for the chart without calculating the
378+
* legend size.
379+
*
380+
* @return
381+
*/
382+
protected abstract float getRequiredBaseOffset();
375383

376384
/**
377385
* Returns the required right offset for the chart.
@@ -383,14 +391,6 @@ private float getFullLegendWidth() {
383391
+ mLegend.getFormSize() + mLegend.getFormToTextSpace();
384392
}
385393

386-
/**
387-
* Returns the base offset needed for the chart without calculating the
388-
* legend size.
389-
*
390-
* @return
391-
*/
392-
protected abstract float getRequiredBaseOffset();
393-
394394
/**
395395
* set a new (e.g. custom) charttouchlistener NOTE: make sure to
396396
* setTouchEnabled(true); if you need touch gestures on the chart

0 commit comments

Comments
 (0)