@@ -4,6 +4,7 @@ import android.content.Context
44import android.graphics.Canvas
55import android.util.AttributeSet
66import android.util.Log
7+ import com.github.mikephil.charting.components.IMarker
78import com.github.mikephil.charting.data.BarData
89import com.github.mikephil.charting.data.BubbleData
910import com.github.mikephil.charting.data.CandleData
@@ -17,6 +18,7 @@ import com.github.mikephil.charting.interfaces.dataprovider.CombinedDataProvider
1718import com.github.mikephil.charting.interfaces.datasets.IBarLineScatterCandleBubbleDataSet
1819import com.github.mikephil.charting.renderer.CombinedChartRenderer
1920
21+
2022/* *
2123 * This chart class allows the combination of lines, bars, scatter and candle
2224 * data all displayed in one chart area.
@@ -209,11 +211,13 @@ open class CombinedChart : BarLineChartBase<Entry, IBarLineScatterCandleBubbleDa
209211 }
210212
211213 // callbacks to update the content
212- val markerItem = marker[i % marker.size]
213- markerItem.refreshContent(e, highlight)
214+ if (! marker.isEmpty()) {
215+ val markerItem: IMarker = marker[i % marker.size]
216+ markerItem.refreshContent(e, highlight)
214217
215- // draw the marker
216- markerItem.draw(canvas, pos[0 ], pos[1 ])
218+ // draw the marker
219+ markerItem.draw(canvas, pos[0 ], pos[1 ])
220+ }
217221 }
218222 }
219223
0 commit comments