@@ -97,46 +97,46 @@ protected void onCreate(Bundle savedInstanceState) {
97
97
98
98
}
99
99
100
- private void removeLastEntry () {
101
-
102
- PieData data = mChart .getDataOriginal ();
103
-
104
- if (data != null ) {
105
-
106
- PieDataSet set = data .getDataSet ();
107
-
108
- if (set != null ) {
109
-
110
- Entry e = set .getEntryForXIndex (set .getEntryCount () - 1 );
111
-
112
- data .removeEntry (e , 0 );
113
- // or remove by index
114
- // mData.removeEntry(xIndex, dataSetIndex);
115
-
116
- mChart .notifyDataSetChanged ();
117
- mChart .invalidate ();
118
- }
119
- }
120
- }
121
-
122
- private void addEntry () {
123
-
124
- PieData data = mChart .getDataOriginal ();
125
-
126
- if (data != null ) {
127
-
128
- PieDataSet set = data .getDataSet ();
129
- // set.addEntry(...);
130
-
131
- data .addEntry (new Entry ((float ) (Math .random () * 50 ) + 50f , set .getEntryCount ()), 0 );
132
-
133
- // let the chart know it's data has changed
134
- mChart .notifyDataSetChanged ();
135
-
136
- // redraw the chart
137
- mChart .invalidate ();
138
- }
139
- }
100
+ // private void removeLastEntry() {
101
+ //
102
+ // PieData data = mChart.getDataOriginal();
103
+ //
104
+ // if (data != null) {
105
+ //
106
+ // PieDataSet set = data.getDataSet();
107
+ //
108
+ // if (set != null) {
109
+ //
110
+ // Entry e = set.getEntryForXIndex(set.getEntryCount() - 1);
111
+ //
112
+ // data.removeEntry(e, 0);
113
+ // // or remove by index
114
+ // // mData.removeEntry(xIndex, dataSetIndex);
115
+ //
116
+ // mChart.notifyDataSetChanged();
117
+ // mChart.invalidate();
118
+ // }
119
+ // }
120
+ // }
121
+ //
122
+ // private void addEntry() {
123
+ //
124
+ // PieData data = mChart.getDataOriginal();
125
+ //
126
+ // if(data != null) {
127
+ //
128
+ // PieDataSet set = data.getDataSet();
129
+ // // set.addEntry(...);
130
+ //
131
+ // data.addEntry(new Entry((float) (Math.random() * 50) + 50f, set.getEntryCount()), 0);
132
+ //
133
+ // // let the chart know it's data has changed
134
+ // mChart.notifyDataSetChanged();
135
+ //
136
+ // // redraw the chart
137
+ // mChart.invalidate();
138
+ // }
139
+ // }
140
140
141
141
@ Override
142
142
public boolean onCreateOptionsMenu (Menu menu ) {
@@ -149,21 +149,21 @@ public boolean onOptionsItemSelected(MenuItem item) {
149
149
150
150
switch (item .getItemId ()) {
151
151
case R .id .actionToggleValues : {
152
- // if (mChart.isDrawYValuesEnabled())
153
- // mChart.setDrawYValues(false);
154
- // else
155
- // mChart.setDrawYValues(true);
156
- // mChart.invalidate();
157
- removeLastEntry ();
152
+ if (mChart .isDrawYValuesEnabled ())
153
+ mChart .setDrawYValues (false );
154
+ else
155
+ mChart .setDrawYValues (true );
156
+ mChart .invalidate ();
157
+ // removeLastEntry();
158
158
break ;
159
159
}
160
160
case R .id .actionTogglePercent : {
161
- // if (mChart.isUsePercentValuesEnabled())
162
- // mChart.setUsePercentValues(false);
163
- // else
164
- // mChart.setUsePercentValues(true);
165
- // mChart.invalidate();
166
- addEntry ();
161
+ if (mChart .isUsePercentValuesEnabled ())
162
+ mChart .setUsePercentValues (false );
163
+ else
164
+ mChart .setUsePercentValues (true );
165
+ mChart .invalidate ();
166
+ // addEntry();
167
167
break ;
168
168
}
169
169
case R .id .actionToggleHole : {
0 commit comments