|
@@ -75,7 +75,10 @@ export default {
|
|
|
statisticFrequencyData: {},
|
|
|
|
|
|
/* 跨品种分析图 */
|
|
|
- crossVarietyChartData: {}
|
|
|
+ crossVarietyChartData: {},
|
|
|
+
|
|
|
+ /* 雷达图 */
|
|
|
+ radarChartData: {}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -1490,6 +1493,116 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ //雷达图数据初始化
|
|
|
+ initRadarData(data) {
|
|
|
+ const { DataResp,EdbInfoList,ChartInfo } = data;
|
|
|
+
|
|
|
+ this.radarChartData = {
|
|
|
+ YDataList: DataResp.YDataList,
|
|
|
+ XDataList: EdbInfoList.filter(_ => DataResp.XEdbIdValue.includes(_.EdbInfoId))
|
|
|
+ }
|
|
|
+ this.chartLimit = {
|
|
|
+ min: Number(ChartInfo.LeftMin),
|
|
|
+ max: Number(ChartInfo.LeftMax)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.setRadarChart();
|
|
|
+ },
|
|
|
+ /*雷达图绘图*/
|
|
|
+ setRadarChart() {
|
|
|
+ const { YDataList,XDataList } = this.radarChartData;
|
|
|
+
|
|
|
+ /* 主题样式*/
|
|
|
+ const chartTheme = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
|
|
|
+
|
|
|
+ //x轴
|
|
|
+ let xAxis = {
|
|
|
+ lineWidth: 0,
|
|
|
+ tickLength: 0,
|
|
|
+ tickmarkPlacement: 'on',
|
|
|
+ categories: XDataList.map(_ => _.EdbAliasName||_.EdbName),
|
|
|
+ labels: {
|
|
|
+ allowOverlap: true,
|
|
|
+ autoRotationLimit: 40,
|
|
|
+ style: {
|
|
|
+ ...chartTheme&&chartTheme.xAxisOptions.style
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //y轴
|
|
|
+ const { max,min } = this.chartLimit;
|
|
|
+ let yAxis = [{
|
|
|
+ gridLineInterpolation: 'polygon',
|
|
|
+ gridLineWidth: 1,
|
|
|
+ lineWidth: 0,
|
|
|
+ endOnTick: false,
|
|
|
+ startOnTick: false,
|
|
|
+ showLastLabel: true,
|
|
|
+ // tickAmount:4,
|
|
|
+ title: {
|
|
|
+ text: this.chartInfo.Unit,
|
|
|
+ textCh: this.chartInfo.Unit,
|
|
|
+ textEn: this.chartInfo.UnitEn,
|
|
|
+ align: 'high',
|
|
|
+ rotation: 0,
|
|
|
+ y: 5,
|
|
|
+ x:10,
|
|
|
+ textAlign: 'left',
|
|
|
+ reserveSpace: false,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ },
|
|
|
+ },
|
|
|
+ labels: {
|
|
|
+ allowOverlap: true,
|
|
|
+ style:{
|
|
|
+ ...chartTheme&&chartTheme.yAxisOptions.style
|
|
|
+ }
|
|
|
+ },
|
|
|
+ min: Number(min),
|
|
|
+ max: Number(max),
|
|
|
+ }]
|
|
|
+
|
|
|
+ //系列
|
|
|
+ let series = [];
|
|
|
+ YDataList.forEach(item => {
|
|
|
+ let serie_item = {
|
|
|
+ data: item.Value,
|
|
|
+ pointPlacement: 'on',
|
|
|
+ type: (chartTheme&&chartTheme.lineOptions.lineType) || 'line',
|
|
|
+ dashStyle: (chartTheme&&chartTheme.lineOptions.dashStyle)||'Solid',
|
|
|
+ yAxis: 0,
|
|
|
+ name: item.Name || item.Date,
|
|
|
+ nameCh: item.Name || item.Date,
|
|
|
+ nameEn: item.Date,
|
|
|
+ color: item.Color,
|
|
|
+ lineWidth: (chartTheme&&chartTheme.lineOptions.lineWidth) || 1,
|
|
|
+ chartType: 'linear'
|
|
|
+ };
|
|
|
+ series.push(serie_item)
|
|
|
+ })
|
|
|
+
|
|
|
+ this.options = {
|
|
|
+ chart: {
|
|
|
+ ...defaultOpts.chart,
|
|
|
+ ...chartTheme.drawOption,
|
|
|
+ spacing: [2,10,2,10],
|
|
|
+ polar:true,
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ text:''
|
|
|
+ },
|
|
|
+ pane: {
|
|
|
+ size: '85%'
|
|
|
+ },
|
|
|
+ series,
|
|
|
+ yAxis,
|
|
|
+ xAxis
|
|
|
+ }
|
|
|
+ this.currentLang=='en' && this.changeOptions();
|
|
|
+ },
|
|
|
+
|
|
|
/* 查询范围为1年内 x轴显示为月/日 否则默认年/月 */
|
|
|
xTimeDiffer() {
|
|
|
const end_date =
|