|
@@ -102,6 +102,9 @@ export default defineComponent({
|
|
|
commodityChartData: [],
|
|
|
commodityXData: [],
|
|
|
commodityEdbList: [],
|
|
|
+
|
|
|
+ /* 统计频率图 */
|
|
|
+ statisticFrequencyData: {}
|
|
|
});
|
|
|
|
|
|
onMounted((): void => {
|
|
@@ -167,7 +170,10 @@ export default defineComponent({
|
|
|
3: initRelevanceChartData,
|
|
|
4: initRelevanceChartData,
|
|
|
5: initCommodityData,
|
|
|
- 6: initFittingEquation
|
|
|
+ 6: initFittingEquation,
|
|
|
+ 7: initStatisticChartData,
|
|
|
+ 8: initStatisticChartData,
|
|
|
+ 9: initStatisticChartData,
|
|
|
}
|
|
|
sourceTypeMap[Data.ChartInfo.Source] && sourceTypeMap[Data.ChartInfo.Source](Data);
|
|
|
|
|
@@ -451,6 +457,92 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /* 统计特征 标准差 百分比 频率 */
|
|
|
+ const initStatisticChartData = (data: { DataResp:any,ChartInfo:any }) => {
|
|
|
+ if(data.ChartInfo.Source === 9) { //频率图
|
|
|
+ state.statisticFrequencyData = data.DataResp;
|
|
|
+ setStatisticFrequency();
|
|
|
+ }else {
|
|
|
+ state.dataList = [data.DataResp];
|
|
|
+ setDefaultLineOptions();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /* 统计频率图 */
|
|
|
+ const setStatisticFrequency = () => {
|
|
|
+ const { DataList,LeftMaxValue,LeftMinValue,RightMaxValue,RightMinValue } = state.statisticFrequencyData;
|
|
|
+
|
|
|
+ let xAxis = {
|
|
|
+ ...scatterXAxis,
|
|
|
+ tickWidth: 1,
|
|
|
+ title: {
|
|
|
+ text: ``,
|
|
|
+ align: 'high',
|
|
|
+ rotation: 0,
|
|
|
+ x: 0,
|
|
|
+ offset: 20,
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //y和系列
|
|
|
+ let yAxis:any[] = [],series:any[] = [];
|
|
|
+ DataList.forEach((item,index) => {
|
|
|
+ let y_item = {
|
|
|
+ ...basicYAxis,
|
|
|
+ title: {
|
|
|
+ text: language.value === 'ch' ? item.Unit : item.UnitEn,
|
|
|
+ align: 'high',
|
|
|
+ rotation: 0,
|
|
|
+ y: -15,
|
|
|
+ offset: 0,
|
|
|
+ },
|
|
|
+ opposite: item.IsAxis===1?false:true,
|
|
|
+ min: index===0? Number(LeftMinValue):Number(RightMinValue),
|
|
|
+ max: index===0? Number(LeftMaxValue):Number(RightMaxValue),
|
|
|
+ tickWidth: 1,
|
|
|
+ }
|
|
|
+
|
|
|
+ let series_item = {
|
|
|
+ data: item.Value.map(_ =>[_.X,_.Y]),
|
|
|
+ type: 'spline',
|
|
|
+ yAxis: index,
|
|
|
+ name: language.value === 'ch' ? item.Name : item.NameEn,
|
|
|
+ color: item.Color,
|
|
|
+ lineWidth: 3,
|
|
|
+ chartType: 'linear',
|
|
|
+ zIndex:1
|
|
|
+ }
|
|
|
+
|
|
|
+ series.push(series_item);
|
|
|
+ yAxis.push(y_item)
|
|
|
+ })
|
|
|
+
|
|
|
+ let tooltip = {
|
|
|
+ formatter: function() {
|
|
|
+ let that:any = this;
|
|
|
+ let xList = DataList[0].Value.map(_ =>_.X);
|
|
|
+ let step = xList[1]-xList[0];
|
|
|
+ let data_interval = `[${Number(that.x).toFixed(2)},${Number(that.x+step).toFixed(2)}]`;
|
|
|
+
|
|
|
+ let str=`<b>${ data_interval }</b>`;
|
|
|
+ that.points.forEach(item => {
|
|
|
+ str += `<br><span style="color:${item.color}">\u25CF</span>${item.series.name}: ${item.y}%<br>`
|
|
|
+ })
|
|
|
+ return str
|
|
|
+ },
|
|
|
+ shared: true
|
|
|
+ }
|
|
|
+
|
|
|
+ state.options = {
|
|
|
+ title: {
|
|
|
+ text:''
|
|
|
+ },
|
|
|
+ tooltip,
|
|
|
+ series,
|
|
|
+ yAxis,
|
|
|
+ xAxis
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//处理英文研报的图表英文设置不全的情况
|
|
|
const setLangFromEnReport = () => {
|
|
@@ -1477,7 +1569,7 @@ export default defineComponent({
|
|
|
const refreshChart = _.debounce(async () => {
|
|
|
loading.value = true;
|
|
|
let res: any=null
|
|
|
- if([1,6].includes(state.chartInfo.Source)){
|
|
|
+ if([1,6,7,8,9].includes(state.chartInfo.Source)){
|
|
|
res=await ChartApi.refreshChart({UniqueCode: state.chartInfo.UniqueCode})
|
|
|
}else if([2,5].includes(state.chartInfo.Source)){
|
|
|
res=await ChartApi.refreshCommordityChart({UniqueCode: state.chartInfo.UniqueCode});
|