|
@@ -4329,6 +4329,10 @@ func SeasonChartData(dataList []*data_manage.ChartEdbInfoMapping, seasonExtraCon
|
|
|
|
|
|
for _, v := range dataTimeMap {
|
|
|
valueList := dataTimeValueMap[v]
|
|
|
+ if len(valueList) <= 0 {
|
|
|
+ err = errors.New(`数据为空`)
|
|
|
+ return
|
|
|
+ }
|
|
|
stdev := utils.CalculateStandardDeviation(valueList)
|
|
|
stdev, _ = decimal.NewFromFloat(stdev).Round(4).Float64()
|
|
|
|
|
@@ -4556,6 +4560,10 @@ func MarkerLineCalculate(markerLine data_manage.MarkersLine, dataList interface{
|
|
|
}
|
|
|
}
|
|
|
averge = averge / float64(length)
|
|
|
+ if len(faloatList) <= 0 {
|
|
|
+ err = errors.New(`数据为空`)
|
|
|
+ return
|
|
|
+ }
|
|
|
stdev := utils.CalculateStandardDeviation(faloatList)
|
|
|
stdev, _ = decimal.NewFromFloat(stdev).Round(4).Float64()
|
|
|
|
|
@@ -4607,6 +4615,10 @@ func MarkerLineCalculate(markerLine data_manage.MarkersLine, dataList interface{
|
|
|
}
|
|
|
averge = averge / float64(length)
|
|
|
|
|
|
+ if len(floatList) <= 0 {
|
|
|
+ err = errors.New(`数据为空`)
|
|
|
+ return
|
|
|
+ }
|
|
|
stdev := utils.CalculateStandardDeviation(floatList)
|
|
|
stdev, _ = decimal.NewFromFloat(stdev).Round(4).Float64()
|
|
|
|