Skip to content

Commit 5ba2573

Browse files
authored
Merge pull request #666 from AppDevNext/FixCombinedClick
Fix click on combined chart
2 parents 5fab62f + 9e9fa46 commit 5ba2573

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chartLib/src/main/kotlin/info/appdev/charting/data/CombinedData.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class CombinedData : BarLineScatterCandleBubbleData<IBarLineScatterCandleBubbleD
113113
}
114114

115115
fun getDataByIndex(index: Int): BarLineScatterCandleBubbleData<*> {
116-
return this.allData.get(index)
116+
return this.allData[index]
117117
}
118118

119119
override fun notifyDataChanged() {
@@ -131,7 +131,7 @@ class CombinedData : BarLineScatterCandleBubbleData<IBarLineScatterCandleBubbleD
131131
* @return the entry that is highlighted
132132
*/
133133
override fun getEntryForHighlight(highlight: Highlight): Entry? {
134-
if (highlight.dataIndex >= this.allData.size)
134+
if (highlight.dataIndex >= this.allData.size || highlight.dataIndex < 0)
135135
return null
136136

137137
val data: ChartData<*> = getDataByIndex(highlight.dataIndex)

0 commit comments

Comments
 (0)