Skip to content

Commit c59e59e

Browse files
committed
Fix merge issues
1 parent dd9aa1a commit c59e59e

File tree

2 files changed

+0
-90
lines changed

2 files changed

+0
-90
lines changed

MPChartLib/src/com/github/mikephil/charting/data/ChartData.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ public abstract class ChartData<T extends DataSet<? extends Entry>> {
3838

3939
protected float mRightAxisMin = 0.0f;
4040

41-
/**
42-
* the total sum of all y-values
43-
*/
44-
private float mYValueSum = 0f;
45-
4641
/**
4742
* total number of y-values across all DataSet objects
4843
*/
@@ -152,7 +147,6 @@ protected void init() {
152147
checkLegal();
153148

154149
calcMinMax(mLastStart, mLastEnd);
155-
calcYValueSum();
156150
calcYValueCount();
157151

158152
calcXValAverageLength();
@@ -283,21 +277,6 @@ public void calcMinMax(int start, int end) {
283277
}
284278
}
285279

286-
/**
287-
* calculates the sum of all y-values in all datasets
288-
*/
289-
protected void calcYValueSum() {
290-
291-
mYValueSum = 0;
292-
293-
if (mDataSets == null)
294-
return;
295-
296-
for (int i = 0; i < mDataSets.size(); i++) {
297-
mYValueSum += mDataSets.get(i).getYValueSum();
298-
}
299-
}
300-
301280
/**
302281
* Calculates the total number of y-values across all DataSets the ChartData
303282
* represents.
@@ -333,15 +312,6 @@ public int getDataSetCount() {
333312
return mDataSets.size();
334313
}
335314

336-
/**
337-
* Returns the average value across all entries in this Data object
338-
* (all entries from the DataSets this data object holds)
339-
* @return
340-
*/
341-
public float getAverage() {
342-
return (float ) getYValueSum() / (float) getYValCount();
343-
}
344-
345315
/**
346316
* Returns the smallest y-value the data object contains.
347317
*
@@ -396,16 +366,6 @@ public float getXValAverageLength() {
396366
return mXValAverageLength;
397367
}
398368

399-
/**
400-
* Returns the total y-value sum across all DataSet objects the this object
401-
* represents.
402-
*
403-
* @return
404-
*/
405-
public float getYValueSum() {
406-
return mYValueSum;
407-
}
408-
409369
/**
410370
* Returns the total number of y-values across all DataSet objects the this
411371
* object represents.
@@ -565,7 +525,6 @@ public void addDataSet(T d) {
565525
return;
566526

567527
mYValCount += d.getEntryCount();
568-
mYValueSum += d.getYValueSum();
569528

570529
if (mDataSets.size() <= 0) {
571530

@@ -642,7 +601,6 @@ public boolean removeDataSet(T d) {
642601
if (removed) {
643602

644603
mYValCount -= d.getEntryCount();
645-
mYValueSum -= d.getYValueSum();
646604

647605
calcMinMax(mLastStart, mLastEnd);
648606
}
@@ -714,7 +672,6 @@ public void addEntry(Entry e, int dataSetIndex) {
714672
}
715673

716674
mYValCount += 1;
717-
mYValueSum += val;
718675

719676
handleEmptyAxis(getFirstLeft(), getFirstRight());
720677

@@ -745,7 +702,6 @@ public boolean removeEntry(Entry e, int dataSetIndex) {
745702
float val = e.getVal();
746703

747704
mYValCount -= 1;
748-
mYValueSum -= val;
749705

750706
calcMinMax(mLastStart, mLastEnd);
751707
}

MPChartLib/src/com/github/mikephil/charting/data/DataSet.java

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ public abstract class DataSet<T extends Entry> {
4444
*/
4545
protected float mYMin = 0.0f;
4646

47-
/**
48-
* the total sum of all y-values
49-
*/
50-
private float mYValueSum = 0f;
51-
5247
/**
5348
* the last start value used for calcMinMax
5449
*/
@@ -126,15 +121,13 @@ public DataSet(List<T> yVals, String label) {
126121
mColors.add(Color.rgb(140, 234, 255));
127122

128123
calcMinMax(mLastStart, mLastEnd);
129-
calcYValueSum();
130124
}
131125

132126
/**
133127
* Use this method to tell the data set that the underlying data has changed
134128
*/
135129
public void notifyDataSetChanged() {
136130
calcMinMax(mLastStart, mLastEnd);
137-
calcYValueSum();
138131
}
139132

140133
/**
@@ -179,29 +172,6 @@ protected void calcMinMax(int start, int end) {
179172
}
180173
}
181174

182-
/**
183-
* calculates the sum of all y-values
184-
*/
185-
private void calcYValueSum() {
186-
187-
mYValueSum = 0;
188-
189-
for (int i = 0; i < mYVals.size(); i++) {
190-
Entry e = mYVals.get(i);
191-
if (e != null)
192-
mYValueSum += e.getVal();
193-
}
194-
}
195-
196-
/**
197-
* Returns the average value across all entries in this DataSet.
198-
*
199-
* @return
200-
*/
201-
public float getAverage() {
202-
return (float) getYValueSum() / (float) getValueCount();
203-
}
204-
205175
/**
206176
* returns the number of y-values this DataSet represents
207177
*
@@ -365,15 +335,6 @@ public List<T> getYVals() {
365335
return mYVals;
366336
}
367337

368-
/**
369-
* gets the sum of all y-values
370-
*
371-
* @return
372-
*/
373-
public float getYValueSum() {
374-
return mYValueSum;
375-
}
376-
377338
/**
378339
* returns the minimum y-value this DataSet holds
379340
*
@@ -556,8 +517,6 @@ public void addEntry(Entry e) {
556517
mYMin = val;
557518
}
558519

559-
mYValueSum += val;
560-
561520
// add the entry
562521
mYVals.add((T) e);
563522
}
@@ -592,8 +551,6 @@ public void addEntryOrdered(Entry e) {
592551
mYMin = val;
593552
}
594553

595-
mYValueSum += val;
596-
597554
if (mYVals.size() > 0 && mYVals.get(mYVals.size() - 1).getXIndex() > e.getXIndex()) {
598555
int closestIndex = getEntryIndex(e.getXIndex(), Rounding.UP);
599556
mYVals.add(closestIndex, (T) e);
@@ -622,7 +579,6 @@ public boolean removeEntry(T e) {
622579
if (removed) {
623580

624581
float val = e.getVal();
625-
mYValueSum -= val;
626582

627583
calcMinMax(mLastStart, mLastEnd);
628584
}
@@ -657,7 +613,6 @@ public boolean removeFirst() {
657613
if (removed) {
658614

659615
float val = entry.getVal();
660-
mYValueSum -= val;
661616

662617
calcMinMax(mLastStart, mLastEnd);
663618
}
@@ -683,7 +638,6 @@ public boolean removeLast() {
683638
if (removed) {
684639

685640
float val = entry.getVal();
686-
mYValueSum -= val;
687641

688642
calcMinMax(mLastStart, mLastEnd);
689643
}

0 commit comments

Comments
 (0)