fixed x axis not using the correct timestamp
This commit is contained in:
parent
b6bd946d9a
commit
070c7228c3
@ -21,7 +21,6 @@ import com.github.mikephil.charting.data.LineDataSet
|
|||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStreamReader
|
import java.io.InputStreamReader
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
@ -193,9 +192,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
position = XAxis.XAxisPosition.BOTTOM
|
position = XAxis.XAxisPosition.BOTTOM
|
||||||
valueFormatter = object : ValueFormatter() {
|
valueFormatter = object : ValueFormatter() {
|
||||||
override fun getFormattedValue(value: Float): String? {
|
override fun getFormattedValue(value: Float): String? {
|
||||||
val time = Date(value.toLong())
|
return "${value.toInt()}s"
|
||||||
val format = SimpleDateFormat("HH:mm:ss", Locale.getDefault())
|
|
||||||
return format.format(time)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
granularity = 1f
|
granularity = 1f
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user