src/main/kotlin/com/flightfeather/uav/common/chart/DataToChartUtil.kt
@@ -1,5 +1,7 @@
package com.flightfeather.uav.common.chart
import com.flightfeather.uav.biz.FactorFilter
import com.flightfeather.uav.common.exception.BizException
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.domain.entity.BaseRealTimeData
import com.flightfeather.uav.socket.eunm.FactorType
@@ -17,10 +19,10 @@
        val dataList = data.map { d ->
            ChartUtil.ChartValue(
                DateUtil.instance.dateToString(d.dataTime, DateUtil.DateStyle.HH_MM_SS),
                d.getByFactorType(type) ?: 0f
                d.getByFactorType(type)?.toDouble() ?: .0
            )
        }
        val dataset = ChartUtil.newDataset(dataList, seriesName)
        return ChartUtil.lineToByteArray(title, dataset)
        val dataset = ChartUtil.newDataset(dataList, seriesName) ?: throw BizException("折线图数据集为空")
        return ChartUtil.lineToByteArray(title, listOf(dataset))
    }
}