|
|
|
@ -114,8 +114,9 @@ class ChartActivity : NoOptionsActivity() {
|
|
|
|
|
granularity = 1f; // 设置X轴坐标之间的最小间隔
|
|
|
|
|
valueFormatter = object : IndexAxisValueFormatter() {
|
|
|
|
|
override fun getFormattedValue(value: Float): String {
|
|
|
|
|
if (value < (mGases?.size ?: 0)) {
|
|
|
|
|
val baseTime = mGases?.get(value.toInt())?.time
|
|
|
|
|
val index = value.toInt();
|
|
|
|
|
if (index >= 0 && index < (mGases?.size ?: 0)) {
|
|
|
|
|
val baseTime = mGases?.get(index)?.time
|
|
|
|
|
return dataFormat.format(baseTime)
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|