Skip to content

Commit 55ff9a9

Browse files
committed
Cosmetic in CombinedChart
1 parent 72a8f56 commit 55ff9a9

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

chartLib/src/main/kotlin/info/appdev/charting/charts/CombinedChart.kt

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,19 @@ open class CombinedChart : BarLineChartBase<CombinedData>, CombinedDataProvider
166166
this.isDrawBarShadowEnabled = value
167167
}
168168

169+
/**
170+
* The order in which the provided data objects should be drawn. The
171+
* earlier you place them in the provided array, the further they will be in
172+
* the background. e.g. if you provide new DrawOrer[] { DrawOrder.BAR,
173+
* DrawOrder.LINE }, the bars will be drawn behind the lines.
174+
*/
169175
var drawOrder: MutableList<DrawOrder>?
170176
get() = drawOrders
171-
/**
172-
* Sets the order in which the provided data objects should be drawn. The
173-
* earlier you place them in the provided array, the further they will be in
174-
* the background. e.g. if you provide new DrawOrer[] { DrawOrder.BAR,
175-
* DrawOrder.LINE }, the bars will be drawn behind the lines.
176-
*/
177-
set(order) {
178-
if (order == null || order.isEmpty()) {
177+
set(value) {
178+
if (value == null || value.isEmpty()) {
179179
return
180180
}
181-
drawOrders = order
181+
drawOrders = value
182182
}
183183

184184
/**
@@ -195,31 +195,29 @@ open class CombinedChart : BarLineChartBase<CombinedData>, CombinedDataProvider
195195
val highlight = it[i]
196196
val dataset = mData!!.getDataSetByHighlight(highlight)
197197

198-
val e = mData!!.getEntryForHighlight(highlight)
199-
if (e == null || dataset == null) {
198+
val entry = mData!!.getEntryForHighlight(highlight)
199+
if (entry == null || dataset == null) {
200200
continue
201201
}
202202

203203
@Suppress("UNCHECKED_CAST")
204204
val set = dataset as IDataSet<Entry>
205-
val entryIndex = set.getEntryIndex(e)
205+
val entryIndex = set.getEntryIndex(entry)
206206

207207
// make sure entry not null
208-
if (entryIndex > set.entryCount * mAnimator.phaseX) {
208+
if (entryIndex > set.entryCount * mAnimator.phaseX)
209209
continue
210-
}
211210

212211
val pos = getMarkerPosition(highlight)
213212

214213
// check bounds
215-
if (!viewPortHandler.isInBounds(pos[0], pos[1])) {
214+
if (!viewPortHandler.isInBounds(pos[0], pos[1]))
216215
continue
217-
}
218216

219217
// callbacks to update the content
220218
if (!marker.isEmpty()) {
221219
val markerItem = marker[i % marker.size]
222-
markerItem.refreshContent(e, highlight)
220+
markerItem.refreshContent(entry, highlight)
223221

224222
// draw the marker
225223
markerItem.draw(canvas, pos[0], pos[1])

0 commit comments

Comments
 (0)