Skip to content

Commit 8faa293

Browse files
committed
Cosmetic
1 parent 7aa09e2 commit 8faa293

2 files changed

Lines changed: 7 additions & 18 deletions

File tree

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/AxisRenderer.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,37 +229,27 @@ abstract class AxisRenderer(
229229

230230
/**
231231
* Draws the axis labels to the screen.
232-
*
233-
* @param canvas
234232
*/
235233
abstract fun renderAxisLabels(canvas: Canvas)
236234

237235
/**
238236
* Draws the grid lines belonging to the axis.
239-
*
240-
* @param canvas
241237
*/
242238
abstract fun renderGridLines(canvas: Canvas)
243239

244240
/**
245241
* Draws the line that goes alongside the axis.
246-
*
247-
* @param canvas
248242
*/
249243
abstract fun renderAxisLine(canvas: Canvas)
250244

251245
/**
252246
* Draws the LimitLines associated with this axis to the screen.
253-
*
254-
* @param canvas
255247
*/
256248
abstract fun renderLimitLines(canvas: Canvas)
257249

258250
/**
259251
* Sets the text color to use for the labels. Make sure to use
260252
* ContextCompat.getColor(context,...) when using a color from the resources.
261-
*
262-
* @param color
263253
*/
264254
fun setTextColor(color: Int) {
265255
axis.textColor = color

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/XAxisRenderer.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ import kotlin.math.roundToInt
2424
open class XAxisRenderer(
2525
viewPortHandler: ViewPortHandler,
2626
@JvmField protected var xAxis: XAxis,
27-
trans: Transformer?
28-
) :
29-
AxisRenderer(viewPortHandler, trans, xAxis) {
27+
transformer: Transformer?
28+
) : AxisRenderer(viewPortHandler, transformer, xAxis) {
3029
protected fun setupGridPaint() {
3130
paintGrid.color = xAxis.gridColor
3231
paintGrid.strokeWidth = xAxis.gridLineWidth
@@ -40,8 +39,8 @@ open class XAxisRenderer(
4039
var minLocal = min
4140
var maxLocal = max
4241
if (viewPortHandler.contentWidth() > 10 && !viewPortHandler.isFullyZoomedOutX) {
43-
val p1 = transformer!!.getValuesByTouchPoint(viewPortHandler.contentLeft(), viewPortHandler.contentTop())
44-
val p2 = transformer!!.getValuesByTouchPoint(viewPortHandler.contentRight(), viewPortHandler.contentTop())
42+
val p1 = this@XAxisRenderer.transformer!!.getValuesByTouchPoint(viewPortHandler.contentLeft(), viewPortHandler.contentTop())
43+
val p2 = this@XAxisRenderer.transformer!!.getValuesByTouchPoint(viewPortHandler.contentRight(), viewPortHandler.contentTop())
4544

4645
if (inverted) {
4746
minLocal = p2.x.toFloat()
@@ -189,7 +188,7 @@ open class XAxisRenderer(
189188
}
190189
}
191190

192-
transformer!!.pointValuesToPixel(positions)
191+
this@XAxisRenderer.transformer!!.pointValuesToPixel(positions)
193192

194193
var i = 0
195194
while (i < positions.size) {
@@ -259,7 +258,7 @@ open class XAxisRenderer(
259258
}
260259
}
261260

262-
transformer!!.pointValuesToPixel(positions)
261+
this@XAxisRenderer.transformer!!.pointValuesToPixel(positions)
263262

264263
setupGridPaint()
265264

@@ -363,7 +362,7 @@ open class XAxisRenderer(
363362
position[0] = limitLine.limit
364363
position[1] = 0f
365364

366-
transformer!!.pointValuesToPixel(position)
365+
this@XAxisRenderer.transformer!!.pointValuesToPixel(position)
367366

368367
renderLimitLineLine(canvas, limitLine, position)
369368
renderLimitLineLabel(canvas, limitLine, position, 2f + limitLine.yOffset)

0 commit comments

Comments
 (0)