|
@@ -456,6 +456,8 @@ func GetRollingCorrelationChartDataByEdbInfo(edbInfoMappingA, edbInfoMappingB *d
|
|
|
endDateTime, _ := time.ParseInLocation(utils.FormatDate, endDate, time.Local)
|
|
|
endDateTime = endDateTime.AddDate(0, 0, -(calculateDay - 1))
|
|
|
|
|
|
+ isStart := false
|
|
|
+
|
|
|
for currDay := startDateTime; !currDay.After(endDateTime); currDay = currDay.AddDate(0, 0, 1) {
|
|
|
yCalculateData := make([]float64, 0)
|
|
|
baseCalculateData := make([]float64, 0)
|
|
@@ -478,6 +480,20 @@ func GetRollingCorrelationChartDataByEdbInfo(edbInfoMappingA, edbInfoMappingB *d
|
|
|
var ratio float64
|
|
|
if len(baseCalculateData) > 0 {
|
|
|
ratio = utils.CalculateCorrelationByIntArr(baseCalculateData, yCalculateData)
|
|
|
+ } else {
|
|
|
+ // 没有数据的话,那就不返回
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
+ // 过滤前面都是0的数据
|
|
|
+ {
|
|
|
+ if ratio != 0 {
|
|
|
+ isStart = true
|
|
|
+ }
|
|
|
+
|
|
|
+ if !isStart {
|
|
|
+ continue
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
dataTime := currDay.AddDate(0, 0, calculateDay-1)
|