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.IOException
|
||||
import java.io.InputStreamReader
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import android.graphics.Color
|
||||
import androidx.core.content.ContextCompat
|
||||
@ -193,9 +192,7 @@ class MainActivity : AppCompatActivity() {
|
||||
position = XAxis.XAxisPosition.BOTTOM
|
||||
valueFormatter = object : ValueFormatter() {
|
||||
override fun getFormattedValue(value: Float): String? {
|
||||
val time = Date(value.toLong())
|
||||
val format = SimpleDateFormat("HH:mm:ss", Locale.getDefault())
|
||||
return format.format(time)
|
||||
return "${value.toInt()}s"
|
||||
}
|
||||
}
|
||||
granularity = 1f
|
||||
|
||||
Loading…
Reference in New Issue
Block a user