Skip to content

Commit d8cb907

Browse files
committed
Minor fix in CombinedData.
1 parent d94bf5b commit d8cb907

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

MPChartLib/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<uses-sdk
88
android:minSdkVersion="8"
9-
android:targetSdkVersion="21" />
9+
android:targetSdkVersion="22" />
1010

1111
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
1212

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.List;
55

66
/**
7-
* Data object that allows the combination of Line-, Bar-, Scatter- and
7+
* Data object that allows the combination of Line-, Bar-, Scatter-, Bubble- and
88
* CandleData. Used in the CombinedChart class.
99
*
1010
* @author Philipp Jahoda
@@ -52,13 +52,13 @@ public void setData(CandleData data) {
5252
mDataSets.addAll(data.getDataSets());
5353
init(data.getDataSets());
5454
}
55-
55+
5656
public void setData(BubbleData data) {
5757
mBubbleData = data;
5858
mDataSets.addAll(data.getDataSets());
5959
init(data.getDataSets());
6060
}
61-
61+
6262
public BubbleData getBubbleData() {
6363
return mBubbleData;
6464
}
@@ -81,9 +81,15 @@ public CandleData getCandleData() {
8181

8282
@Override
8383
public void notifyDataChanged() {
84-
mLineData.notifyDataChanged();
85-
mBarData.notifyDataChanged();
86-
mCandleData.notifyDataChanged();
87-
mScatterData.notifyDataChanged();
84+
if (mLineData != null)
85+
mLineData.notifyDataChanged();
86+
if (mBarData != null)
87+
mBarData.notifyDataChanged();
88+
if (mCandleData != null)
89+
mCandleData.notifyDataChanged();
90+
if (mScatterData != null)
91+
mScatterData.notifyDataChanged();
92+
if (mBubbleData != null)
93+
mBubbleData.notifyDataChanged();
8894
}
8995
}

0 commit comments

Comments
 (0)