Skip to content

Commit 62d2ec3

Browse files
committed
Cosmetic
1 parent d2c1a7a commit 62d2ec3

10 files changed

Lines changed: 20 additions & 16 deletions

File tree

MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarChart.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ open class BarChart : BarLineChartBase<BarData>, BarDataProvider {
187187

188188
outputRect.set(left, top, right, bottom)
189189

190-
getTransformer(set.axisDependency)!!.rectValueToPixel(outputRect)
190+
getTransformer(set.axisDependency).rectValueToPixel(outputRect)
191191
}
192192
}
193193

MPChartLib/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ protected void drawGridBackground(Canvas c) {
550550
* responsible for transforming values into pixels on the screen and
551551
* backwards.
552552
*/
553+
@NonNull
553554
public Transformer getTransformer(AxisDependency which) {
554555
if (which == AxisDependency.LEFT) {
555556
return mLeftAxisTransformer;

MPChartLib/src/main/java/com/github/mikephil/charting/charts/BubbleChart.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import com.github.mikephil.charting.renderer.BubbleChartRenderer
1212
* is the area of the bubble, not the radius or diameter of the bubble that
1313
* conveys the data.
1414
*/
15-
class BubbleChart : BarLineChartBase<BubbleData?>, BubbleDataProvider {
15+
class BubbleChart : BarLineChartBase<BubbleData>, BubbleDataProvider {
1616
constructor(context: Context?) : super(context)
1717

1818
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)

MPChartLib/src/main/java/com/github/mikephil/charting/charts/HorizontalBarChart.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ open class HorizontalBarChart : BarChart {
226226

227227
outputRect.set(left, top, right, bottom)
228228

229-
getTransformer(set!!.axisDependency)!!.rectValueToPixel(outputRect)
229+
getTransformer(set!!.axisDependency).rectValueToPixel(outputRect)
230230
}
231231
}
232232

@@ -244,7 +244,7 @@ open class HorizontalBarChart : BarChart {
244244
vals[0] = e.y
245245
vals[1] = e.x
246246

247-
getTransformer(axis)!!.pointValuesToPixel(vals)
247+
getTransformer(axis).pointValuesToPixel(vals)
248248

249249
return getInstance(vals[0], vals[1])
250250
}
@@ -266,7 +266,7 @@ open class HorizontalBarChart : BarChart {
266266

267267
override val lowestVisibleX: Float
268268
get() {
269-
getTransformer(AxisDependency.LEFT)!!.getValuesByTouchPoint(
269+
getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(
270270
viewPortHandler.contentLeft(),
271271
viewPortHandler.contentBottom(), posForGetLowestVisibleX
272272
)
@@ -275,7 +275,7 @@ open class HorizontalBarChart : BarChart {
275275

276276
override val highestVisibleX: Float
277277
get() {
278-
getTransformer(AxisDependency.LEFT)!!.getValuesByTouchPoint(
278+
getTransformer(AxisDependency.LEFT).getValuesByTouchPoint(
279279
viewPortHandler.contentLeft(),
280280
viewPortHandler.contentTop(), posForGetHighestVisibleX
281281
)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,8 @@ open class BarChartRenderer(
504504
for (high in indices) {
505505
val set = barData?.getDataSetByIndex(high.dataSetIndex)
506506

507-
if (set == null || !set.isHighlightEnabled) {
507+
if (set == null || !set.isHighlightEnabled)
508508
continue
509-
}
510509

511510
val barEntry = set.getEntryForXValue(high.x, high.y)!!
512511

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ open class CandleStickChartRenderer(
295295
for (high in indices) {
296296
val set = candleData?.getDataSetByIndex(high.dataSetIndex)
297297

298-
if (set == null || !set.isHighlightEnabled) continue
298+
if (set == null || !set.isHighlightEnabled)
299+
continue
299300

300301
val candleEntry = set.getEntryForXValue(high.x, high.y)
301302

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,8 @@ open class LineChartRenderer(
653653
for (high in indices) {
654654
val set = lineData?.getDataSetByIndex(high.dataSetIndex)
655655

656-
if (set == null || !set.isHighlightEnabled) continue
656+
if (set == null || !set.isHighlightEnabled)
657+
continue
657658

658659
set.getEntryForXValue(high.x, high.y)?.let { entry ->
659660

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import androidx.core.graphics.createBitmap
1414
import androidx.core.graphics.withSave
1515
import com.github.mikephil.charting.animation.ChartAnimator
1616
import com.github.mikephil.charting.charts.PieChart
17-
import com.github.mikephil.charting.data.PieData
1817
import com.github.mikephil.charting.data.PieDataSet.ValuePosition
1918
import com.github.mikephil.charting.highlight.Highlight
2019
import com.github.mikephil.charting.interfaces.datasets.IPieDataSet
@@ -546,7 +545,8 @@ open class PieChartRenderer(
546545

547546
// draw everything, depending on settings
548547
if (drawXInside && drawYInside) {
549-
drawValue(this, formatter, value, entry, 0, x, y, dataSet.getValueTextColor(j)
548+
drawValue(
549+
this, formatter, value, entry, 0, x, y, dataSet.getValueTextColor(j)
550550
)
551551

552552
if (j < data.entryCount && entryLabel != null) {
@@ -768,7 +768,8 @@ open class PieChartRenderer(
768768

769769
val set = chart.getData()?.getDataSetByIndex(indices[i].dataSetIndex)
770770

771-
if (set == null || !set.isHighlightEnabled) continue
771+
if (set == null || !set.isHighlightEnabled)
772+
continue
772773

773774
val entryCount = set.entryCount
774775
var visibleAngleCount = 0

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ class RoundedBarChartRenderer(chart: BarDataProvider, animator: ChartAnimator, v
262262
for (high in indices) {
263263
val set = barData.getDataSetByIndex(high.dataSetIndex)
264264

265-
if (set == null || !set.isHighlightEnabled) {
265+
if (set == null || !set.isHighlightEnabled)
266266
continue
267-
}
267+
268268

269269
set.getEntryForXValue(high.x, high.y)?.let { barEntry ->
270270

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ open class ScatterChartRenderer(@JvmField var dataProvider: ScatterDataProvider,
163163
for (high in indices) {
164164
val set = scatterData?.getDataSetByIndex(high.dataSetIndex)
165165

166-
if (set == null || !set.isHighlightEnabled) continue
166+
if (set == null || !set.isHighlightEnabled)
167+
continue
167168

168169
set.getEntryForXValue(high.x, high.y)?.let { entry ->
169170

0 commit comments

Comments
 (0)