@@ -5,7 +5,6 @@ import android.util.AttributeSet
55import info.appdev.charting.data.LineData
66import info.appdev.charting.interfaces.dataprovider.LineDataProvider
77import info.appdev.charting.renderer.LineChartRenderer
8- import java.util.Locale
98
109open class LineChart : BarLineChartBase <LineData >, LineDataProvider {
1110
@@ -39,9 +38,6 @@ open class LineChart : BarLineChartBase<LineData>, LineDataProvider {
3938
4039 override val accessibilityDescription: String
4140 get() {
42- val lineData = lineData
43- val numberOfPoints = lineData.entryCount
44-
4541 // Min and max values...
4642 val yAxisValueFormatter = axisLeft.valueFormatter
4743 val minVal = yAxisValueFormatter?.getFormattedValue(lineData.yMin, null )
@@ -51,13 +47,10 @@ open class LineChart : BarLineChartBase<LineData>, LineDataProvider {
5147 val xAxisValueFormatter = xAxis.valueFormatter
5248 val minRange = xAxisValueFormatter?.getFormattedValue(lineData.xMin, null )
5349 val maxRange = xAxisValueFormatter?.getFormattedValue(lineData.xMax, null )
54- val entries = if (numberOfPoints == 1 ) " entry" else " entries"
55- return String .format(
56- Locale .getDefault(), " The line chart has %d %s. " +
57- " The minimum value is %s and maximum value is %s." +
58- " Data ranges from %s to %s." ,
59- numberOfPoints, entries, minVal, maxVal, minRange, maxRange
60- )
50+ val pluralOrSingular = if (lineData.entryCount == 1 ) " entry" else " entries"
51+ return " The line chart has ${lineData.entryCount} $pluralOrSingular . " +
52+ " The minimum value is $minVal and maximum value is $maxVal ." +
53+ " Data ranges from $minRange to $maxRange ."
6154 }
6255
6356}
0 commit comments