Skip to content

Commit 6aa05d6

Browse files
committed
Cosmetic
1 parent a42bac9 commit 6aa05d6

File tree

5 files changed

+42
-30
lines changed

5 files changed

+42
-30
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,19 @@ open class BarChart : BarLineChartBase<BarData>, BarDataProvider {
9595
return null
9696
} else {
9797
highlighter?.let {
98-
val h = it.getHighlight(x, y)
99-
if (h == null || !isHighlightFullBar)
100-
return h
98+
val highlight = it.getHighlight(x, y)
99+
if (highlight == null || !isHighlightFullBar)
100+
return highlight
101101

102102
// For isHighlightFullBarEnabled, remove stackIndex
103103
return Highlight(
104-
h.x, h.y,
105-
h.xPx, h.yPx,
106-
h.dataSetIndex, -1, h.axis
104+
x = highlight.x,
105+
y = highlight.y,
106+
xPx = highlight.xPx,
107+
yPx = highlight.yPx,
108+
dataSetIndex = highlight.dataSetIndex,
109+
stackIndex = -1,
110+
axis = highlight.axis
107111
)
108112
}
109113
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,13 @@ open class CombinedChart : BarLineChartBase<CombinedData>, CombinedDataProvider
400400

401401
// For isHighlightFullBarEnabled, remove stackIndex
402402
return Highlight(
403-
highlight.x,
404-
highlight.y,
405-
highlight.xPx,
406-
highlight.yPx,
407-
highlight.dataSetIndex,
408-
-1,
409-
highlight.axis
403+
x = highlight.x,
404+
y = highlight.y,
405+
xPx = highlight.xPx,
406+
yPx = highlight.yPx,
407+
dataSetIndex = highlight.dataSetIndex,
408+
stackIndex = -1,
409+
axis = highlight.axis
410410
)
411411
}
412412
}

chartLib/src/main/kotlin/info/appdev/charting/highlight/BarHighlighter.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ open class BarHighlighter(barDataProvider: BarDataProvider) : ChartHighlighter<B
4949
val pixels = provider.getTransformer(set.axisDependency)!!.getPixelForValues(high.x, ranges[stackIndex].to)
5050

5151
val stackedHigh = Highlight(
52-
entry.x,
53-
entry.y,
54-
pixels.x.toFloat(),
55-
pixels.y.toFloat(),
56-
high.dataSetIndex,
57-
stackIndex,
58-
high.axis
52+
x = entry.x,
53+
y = entry.y,
54+
xPx = pixels.x.toFloat(),
55+
yPx = pixels.y.toFloat(),
56+
dataSetIndex = high.dataSetIndex,
57+
stackIndex = stackIndex,
58+
axis = high.axis
5959
)
6060

6161
PointD.recycleInstance(pixels)

chartLib/src/main/kotlin/info/appdev/charting/highlight/ChartHighlighter.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ open class ChartHighlighter<T : BarLineScatterCandleBubbleDataProvider<*>>(prote
114114
* An array of `Highlight` objects corresponding to the selected xValue and dataSetIndex.
115115
*/
116116
@Suppress("SameParameterValue")
117-
protected open fun buildHighlights(set: IDataSet<*>, dataSetIndex: Int, xVal: Float, rounding: DataSet.Rounding?): MutableList<Highlight> {
117+
protected open fun buildHighlights(
118+
set: IDataSet<*>,
119+
dataSetIndex: Int,
120+
xVal: Float,
121+
rounding: DataSet.Rounding?
122+
): MutableList<Highlight> {
118123
val highlights = ArrayList<Highlight>()
119124

120125
var entries = set.getEntriesForXValue(xVal)
@@ -135,9 +140,12 @@ open class ChartHighlighter<T : BarLineScatterCandleBubbleDataProvider<*>>(prote
135140

136141
highlights.add(
137142
Highlight(
138-
e.x, e.y,
139-
pixels.x.toFloat(), pixels.y.toFloat(),
140-
dataSetIndex, set.axisDependency
143+
x = e.x,
144+
y = e.y,
145+
xPx = pixels.x.toFloat(),
146+
yPx = pixels.y.toFloat(),
147+
dataSetIndex = dataSetIndex,
148+
axis = set.axisDependency
141149
)
142150
)
143151
}

chartLib/src/main/kotlin/info/appdev/charting/highlight/Highlight.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ class Highlight : Serializable {
108108
* selected
109109
*/
110110
constructor(x: Float, y: Float, xPx: Float, yPx: Float, dataSetIndex: Int, stackIndex: Int, axis: AxisDependency?) : this(
111-
x,
112-
y,
113-
xPx,
114-
yPx,
115-
dataSetIndex,
116-
axis
111+
x = x,
112+
y = y,
113+
xPx = xPx,
114+
yPx = yPx,
115+
dataSetIndex = dataSetIndex,
116+
axis = axis
117117
) {
118118
this.stackIndex = stackIndex
119119
}

0 commit comments

Comments
 (0)