|
@@ -168,7 +168,7 @@ export default defineComponent({
|
|
|
const sourceTypeMap = {
|
|
|
2: initCommodityData,
|
|
|
3: initRelevanceChartData,
|
|
|
- 4: initRelevanceChartData,
|
|
|
+ 4: initStatisticChartData,
|
|
|
5: initCommodityData,
|
|
|
6: initFittingEquation,
|
|
|
7: initStatisticChartData,
|
|
@@ -208,7 +208,7 @@ export default defineComponent({
|
|
|
align: 'high',
|
|
|
rotation: 0,
|
|
|
x: 0,
|
|
|
- y:10,
|
|
|
+ y:2,
|
|
|
offset: 20,
|
|
|
},
|
|
|
tickInterval: 1,
|
|
@@ -233,11 +233,11 @@ export default defineComponent({
|
|
|
},
|
|
|
align: 'center',
|
|
|
},
|
|
|
- min: -1,
|
|
|
- max: 1,
|
|
|
+ // min: -1,
|
|
|
+ // max: 1,
|
|
|
opposite: false,
|
|
|
tickWidth: 1,
|
|
|
- tickInterval:0.2,
|
|
|
+ // tickInterval:0.2,
|
|
|
}
|
|
|
|
|
|
//处理series
|
|
@@ -461,13 +461,15 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /* 统计特征 标准差 百分比 频率 */
|
|
|
- const initStatisticChartData = (data: { DataResp:any,ChartInfo:any }) => {
|
|
|
+ const correlationChartInfo = ref<any>({});
|
|
|
+ /* 统计特征 标准差 百分比 频率 滚动相关性*/
|
|
|
+ const initStatisticChartData = (data: { DataResp:any,ChartInfo:any,CorrelationChartInfo:any }) => {
|
|
|
if(data.ChartInfo.Source === 9) { //频率图
|
|
|
state.statisticFrequencyData = data.DataResp;
|
|
|
setStatisticFrequency();
|
|
|
}else {
|
|
|
state.dataList = [data.DataResp];
|
|
|
+ if(data.ChartInfo.Source === 4) correlationChartInfo.value = data.CorrelationChartInfo;
|
|
|
setDefaultLineOptions();
|
|
|
}
|
|
|
}
|
|
@@ -707,6 +709,31 @@ export default defineComponent({
|
|
|
yAxis: ydata,
|
|
|
xAxis
|
|
|
};
|
|
|
+
|
|
|
+ //滚动相关性独立tooltip
|
|
|
+ if(chartInfo.Source === 4) {
|
|
|
+ const relevanceUnitEnMap={
|
|
|
+ '年': 'Year',
|
|
|
+ '季': 'Season',
|
|
|
+ '月': 'Month',
|
|
|
+ '周': 'Week',
|
|
|
+ '天': 'Day',
|
|
|
+ }
|
|
|
+ const { LeadValue,LeadUnit } = correlationChartInfo.value;
|
|
|
+ state.options.tooltip = {
|
|
|
+ formatter: function() {
|
|
|
+ let that:any = this;
|
|
|
+ let str = '';
|
|
|
+
|
|
|
+ if(language.value=='ch'){
|
|
|
+ str = `${Highcharts.dateFormat('%Y/%m/%d',that.x)}<br><p>相关性系数:${that.y.toFixed(4)}</p><br><p>领先${LeadValue+LeadUnit}</p>`
|
|
|
+ }else{
|
|
|
+ str = `${Highcharts.dateFormat('%Y/%m/%d',that.x)}<br><p>Correlation coefficient:${that.y.toFixed(4)}</p><br><p>lead${LeadValue+relevanceUnitEnMap[LeadUnit]}</p>`
|
|
|
+ }
|
|
|
+ return str
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* 设置x轴步长 刻度数量多一点 */
|