|
@@ -164,7 +164,8 @@ export default defineComponent({
|
|
|
|
|
|
const sourceTypeMap = {
|
|
|
2: initCommodityData,
|
|
|
- 3: initRelevanceChartData
|
|
|
+ 3: initRelevanceChartData,
|
|
|
+ 4: initRelevanceChartData
|
|
|
}
|
|
|
sourceTypeMap[Data.ChartInfo.Source] && sourceTypeMap[Data.ChartInfo.Source](Data);
|
|
|
|
|
@@ -189,10 +190,10 @@ export default defineComponent({
|
|
|
}
|
|
|
// 处理X轴
|
|
|
let xAxis={
|
|
|
- categories: data.XEdbIdValue,
|
|
|
+ categories: data.ChartInfo.Source===3 ? data.XEdbIdValue : data.DataResp.XDateTimeValue,
|
|
|
tickWidth: 1,
|
|
|
title: {
|
|
|
- text: language.value=='ch'?`期数(${data.CorrelationChartInfo.LeadUnit})`:`stage(${relevanceUnitEnMap[data.CorrelationChartInfo.LeadUnit]})`,
|
|
|
+ text: data.ChartInfo.Source===3 ? (language.value=='ch'?`期数(${data.CorrelationChartInfo.LeadUnit})`:`stage(${relevanceUnitEnMap[data.CorrelationChartInfo.LeadUnit]})`):null,
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
x: 0,
|
|
@@ -200,7 +201,7 @@ export default defineComponent({
|
|
|
offset: 20,
|
|
|
},
|
|
|
tickInterval: 1,
|
|
|
- offset:-85,
|
|
|
+ offset:0,
|
|
|
tickmarkPlacement:'on'
|
|
|
}
|
|
|
|
|
@@ -209,8 +210,6 @@ export default defineComponent({
|
|
|
...basicYAxis,
|
|
|
title: {
|
|
|
text: language.value=='ch'?'相关性系数':'Correlation coefficient',
|
|
|
- // textCh: '相关性系数',
|
|
|
- // textEn: 'Correlation coefficient',
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
y: -15,
|
|
@@ -238,8 +237,6 @@ export default defineComponent({
|
|
|
type: 'spline',
|
|
|
yAxis: 0,
|
|
|
name: language.value=='ch'?data.ChartInfo.ChartName:data.ChartInfo.ChartNameEn,
|
|
|
- // nameCh: data.ChartInfo.ChartName,
|
|
|
- // nameEn: data.ChartInfo.ChartNameEn,
|
|
|
color: item.Color,
|
|
|
chartType: 'linear',
|
|
|
lineWidth: 3,
|
|
@@ -250,32 +247,26 @@ export default defineComponent({
|
|
|
seriesData.push(serie_item)
|
|
|
})
|
|
|
|
|
|
+ const { LeadValue,LeadUnit } = data.CorrelationChartInfo;
|
|
|
let tooltip = {
|
|
|
|
|
|
formatter: function() {
|
|
|
- let str=''
|
|
|
+ const that:any = this;
|
|
|
+ let str='';
|
|
|
if(language.value=='ch'){
|
|
|
- str = `<p>相关性系数:${this.y.toFixed(4)}</p><br><p>领先${this.x}期</p>`
|
|
|
+ str = `<p>相关性系数:${that.y.toFixed(4)}</p><br><p>领先${ data.ChartInfo.Source===3 ?that.x+'期' : LeadValue+LeadUnit}</p>`
|
|
|
}else{
|
|
|
- str = `<p>Correlation coefficient:${this.y.toFixed(4)}</p><br><p>lead${this.x}stage</p>`
|
|
|
+ str = `<p>Correlation coefficient:${that.y.toFixed(4)}</p><br><p>lead${ data.ChartInfo.Source===3 ? that.x+'stage' : LeadValue+relevanceUnitEnMap[LeadUnit]}</p>`
|
|
|
}
|
|
|
|
|
|
return str
|
|
|
},
|
|
|
- // formatterCh: function() {
|
|
|
- // let str = `<p>相关性系数:${this.y.toFixed(4)}</p><br><p>领先${this.x}期</p>`
|
|
|
- // return str
|
|
|
- // },
|
|
|
- // formatterEn: function() {
|
|
|
- // let str = `<p>Correlation coefficient:${this.y.toFixed(4)}</p><br><p>lead${this.x}stage</p>`
|
|
|
- // return str
|
|
|
- // }
|
|
|
}
|
|
|
|
|
|
state.options = {
|
|
|
- isRelevanceChart:true,
|
|
|
+ isRelevanceChart:data.ChartInfo.Source===3,
|
|
|
title: {
|
|
|
- text:''
|
|
|
+ text:'',
|
|
|
},
|
|
|
series: seriesData,
|
|
|
yAxis: [yAxis] ,
|