Skip to content

Commit

Permalink
Added .jar file.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilJay committed Oct 6, 2014
1 parent 1d99ab4 commit bb65094
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 53 deletions.
Binary file not shown.
1 change: 0 additions & 1 deletion MPChartExample/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@

# Project target.
target=android-19
android.library.reference.1=../MPChartLib
Original file line number Diff line number Diff line change
Expand Up @@ -97,46 +97,46 @@ protected void onCreate(Bundle savedInstanceState) {

}

private void removeLastEntry() {

PieData data = mChart.getDataOriginal();

if (data != null) {

PieDataSet set = data.getDataSet();

if (set != null) {

Entry e = set.getEntryForXIndex(set.getEntryCount() - 1);

data.removeEntry(e, 0);
// or remove by index
// mData.removeEntry(xIndex, dataSetIndex);

mChart.notifyDataSetChanged();
mChart.invalidate();
}
}
}

private void addEntry() {

PieData data = mChart.getDataOriginal();

if(data != null) {

PieDataSet set = data.getDataSet();
// set.addEntry(...);

data.addEntry(new Entry((float) (Math.random() * 50) + 50f, set.getEntryCount()), 0);

// let the chart know it's data has changed
mChart.notifyDataSetChanged();

// redraw the chart
mChart.invalidate();
}
}
// private void removeLastEntry() {
//
// PieData data = mChart.getDataOriginal();
//
// if (data != null) {
//
// PieDataSet set = data.getDataSet();
//
// if (set != null) {
//
// Entry e = set.getEntryForXIndex(set.getEntryCount() - 1);
//
// data.removeEntry(e, 0);
// // or remove by index
// // mData.removeEntry(xIndex, dataSetIndex);
//
// mChart.notifyDataSetChanged();
// mChart.invalidate();
// }
// }
// }
//
// private void addEntry() {
//
// PieData data = mChart.getDataOriginal();
//
// if(data != null) {
//
// PieDataSet set = data.getDataSet();
// // set.addEntry(...);
//
// data.addEntry(new Entry((float) (Math.random() * 50) + 50f, set.getEntryCount()), 0);
//
// // let the chart know it's data has changed
// mChart.notifyDataSetChanged();
//
// // redraw the chart
// mChart.invalidate();
// }
// }

@Override
public boolean onCreateOptionsMenu(Menu menu) {
Expand All @@ -149,21 +149,21 @@ public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()) {
case R.id.actionToggleValues: {
// if (mChart.isDrawYValuesEnabled())
// mChart.setDrawYValues(false);
// else
// mChart.setDrawYValues(true);
// mChart.invalidate();
removeLastEntry();
if (mChart.isDrawYValuesEnabled())
mChart.setDrawYValues(false);
else
mChart.setDrawYValues(true);
mChart.invalidate();
// removeLastEntry();
break;
}
case R.id.actionTogglePercent: {
// if (mChart.isUsePercentValuesEnabled())
// mChart.setUsePercentValues(false);
// else
// mChart.setUsePercentValues(true);
// mChart.invalidate();
addEntry();
if (mChart.isUsePercentValuesEnabled())
mChart.setUsePercentValues(false);
else
mChart.setUsePercentValues(true);
mChart.invalidate();
// addEntry();
break;
}
case R.id.actionToggleHole: {
Expand Down

0 comments on commit bb65094

Please sign in to comment.