Skip to content

Commit b49a638

Browse files
authored
Merge pull request #464 from AppDevNext/KotlinIDataSet
Kotlin IDataSet
2 parents 164c7c2 + e7e8677 commit b49a638

File tree

69 files changed

+1971
-2091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1971
-2091
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ open class LineChart : BarLineChartBase<LineData?>, LineDataProvider {
3939

4040
// Min and max values...
4141
val yAxisValueFormatter = axisLeft.valueFormatter
42-
val minVal = yAxisValueFormatter.getFormattedValue(lineData.yMin, null)
43-
val maxVal = yAxisValueFormatter.getFormattedValue(lineData.yMax, null)
42+
val minVal = yAxisValueFormatter?.getFormattedValue(lineData.yMin, null)
43+
val maxVal = yAxisValueFormatter?.getFormattedValue(lineData.yMax, null)
4444

4545
// Data range...
4646
val xAxisValueFormatter = xAxis.valueFormatter
47-
val minRange = xAxisValueFormatter.getFormattedValue(lineData.xMin, null)
48-
val maxRange = xAxisValueFormatter.getFormattedValue(lineData.xMax, null)
47+
val minRange = xAxisValueFormatter?.getFormattedValue(lineData.xMin, null)
48+
val maxRange = xAxisValueFormatter?.getFormattedValue(lineData.xMax, null)
4949
val entries = if (numberOfPoints == 1) "entry" else "entries"
5050
return String.format(
5151
Locale.getDefault(), "The line chart has %d %s. " +

MPChartLib/src/main/java/com/github/mikephil/charting/components/LimitLine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class LimitLine extends ComponentBase {
1717

1818
/** limit / maximum (the y-value or xIndex) */
19-
private float mLimit;
19+
private final float mLimit;
2020

2121
/** the width of the limit line */
2222
private float mLineWidth = 2f;
@@ -130,7 +130,7 @@ public void disableDashedLine() {
130130
* disabled
131131
*/
132132
public boolean isDashedLineEnabled() {
133-
return mDashPathEffect == null ? false : true;
133+
return mDashPathEffect != null;
134134
}
135135

136136
/**

MPChartLib/src/main/java/com/github/mikephil/charting/components/LimitRange.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public float getHigh() {
3939
/**
4040
* limit / maximum (the y-value or xIndex)
4141
*/
42-
private Range mLimit;
42+
private final Range mLimit;
4343

4444
/**
4545
* the width of the limit line
@@ -182,7 +182,7 @@ public void disableDashedLine() {
182182
* disabled
183183
*/
184184
public boolean isDashedLineEnabled() {
185-
return mDashPathEffect == null ? false : true;
185+
return mDashPathEffect != null;
186186
}
187187

188188
/**

0 commit comments

Comments
 (0)