|
@@ -2265,8 +2265,13 @@ const setAxisPlotLines = (axis: number, axisType: any = null) => {
|
|
|
let markerValue:number;
|
|
|
if (isXDateAxis) {
|
|
|
//季节图x轴额外拼个年份
|
|
|
- let nowYear = ChartType===2 ? new Date(state.dataList[0].DataList[1].DataList
|
|
|
- [0].DataTimestamp).getFullYear() : '';
|
|
|
+ let nowYear: any = '';
|
|
|
+ if(ChartType===2) { //随意取个数据点的年份即可
|
|
|
+ let data = state.dataList[0].DataList;
|
|
|
+ nowYear = (data[0].DataList&&data[0].DataList.length)
|
|
|
+ ? new Date(data[0].DataList[0].DataTimestamp).getFullYear()
|
|
|
+ : new Date(data[1].DataList[0].DataTimestamp).getFullYear();
|
|
|
+ }
|
|
|
markerValue =
|
|
|
ChartType === 2
|
|
|
? new Date(`${nowYear}-${_.value}`).getTime()
|
|
@@ -2307,8 +2312,13 @@ const setAxisPlotAreas = (axis: number, axisType: any = null) => {
|
|
|
let fromMarkerValue:number, toMarkerValue:number;
|
|
|
if (isXDateAxis) {
|
|
|
//季节图x轴额外拼个年份
|
|
|
- let nowYear = ChartType===2 ? new Date(state.dataList[0].DataList[1].DataList
|
|
|
- [0].DataTimestamp).getFullYear() : '';
|
|
|
+ let nowYear: any = '';
|
|
|
+ if(ChartType===2) { //随意取个数据点的年份即可
|
|
|
+ let data = state.dataList[0].DataList;
|
|
|
+ nowYear = (data[0].DataList&&data[0].DataList.length)
|
|
|
+ ? new Date(data[0].DataList[0].DataTimestamp).getFullYear()
|
|
|
+ : new Date(data[1].DataList[0].DataTimestamp).getFullYear();
|
|
|
+ }
|
|
|
fromMarkerValue =
|
|
|
ChartType === 2
|
|
|
? new Date(`${nowYear}-${_.fromValue}`).getTime()
|