diff --git a/src/components/graph/Entity1Form.vue b/src/components/graph/Entity1Form.vue index 0f39359..12d7c0f 100644 --- a/src/components/graph/Entity1Form.vue +++ b/src/components/graph/Entity1Form.vue @@ -26,20 +26,7 @@ > - -
-
- 图形样式 - - - -
-
+
纵坐标参考列 @@ -61,6 +48,20 @@
+
+
+ 图形样式 + + + +
+
+ diff --git a/src/components/graph/Entity4Form.vue b/src/components/graph/Entity4Form.vue index 0e521cd..38e5b81 100644 --- a/src/components/graph/Entity4Form.vue +++ b/src/components/graph/Entity4Form.vue @@ -73,7 +73,7 @@ watch(() => props.rowOptions, (newVal) => { // 更新rowOptions2,将新数据插入到指定位置 rowOptions2.value = [ - { value: 'entity', label: '线索数' }, // 保留原有数据 + { value: '线索数量', label: '线索数量' }, // 保留原有数据 ...newVal // 将新的选项添加进来 ]; }, { immediate: true }); diff --git a/src/views/ShowGraph.vue b/src/views/ShowGraph.vue index 6f6c0b0..7b3fb4f 100644 --- a/src/views/ShowGraph.vue +++ b/src/views/ShowGraph.vue @@ -51,7 +51,7 @@ import * as echarts from 'echarts'; placeholder="输入需要选择的实体名称" clearable /> - 确定 + 确定 @@ -401,7 +401,7 @@ export default { for (let i=0;i1) - { - this.ISmul4=true; - } + }, handleSelectedRow3(value) { // console.log('Selected Row3:', value); @@ -741,8 +773,8 @@ currentDate.setDate(currentDate.getDate()+1); this.chartInstance =markRaw( echarts.init(chartContainer)); // console.log(chartContainer); let option; - if (!this.entity) - { + + if (this.stype === 'bar' || this.stype == 'line') { option = { toolbox: { @@ -920,7 +952,9 @@ currentDate.setDate(currentDate.getDate()+1); } else{ - option.legend.data = this.Selectedcul; + let legend=this.convertname(this.Selectedcul); + option.legend.data = legend; + if(this.gap === 'year'){ let datas = this.mytable; datas.sort((a,b) => new Date(a[this.srow]) - new Date(b[this.srow])) @@ -939,7 +973,7 @@ currentDate.setDate(currentDate.getDate()+1); else ydata[ydata.length-1] += c[now_i]; } option.series.push({ - name: now_i, + name: legend[this.Selectedcul.indexOf(now_i)], type: this.stype, emphasis: { focus: 'series' @@ -984,7 +1018,7 @@ currentDate.setDate(currentDate.getDate()+1); else ydata[ydata.length-1] += c[now_i]; } option.series.push({ - name: now_i, + name: legend[this.Selectedcul.indexOf(now_i)], type: this.stype, emphasis: { focus: 'series' @@ -1027,7 +1061,7 @@ currentDate.setDate(currentDate.getDate()+1); else ydata[ydata.length-1] += c[now_i]; } option.series.push({ - name: now_i, + name: legend[this.Selectedcul.indexOf(now_i)], type: this.stype, emphasis: { focus: 'series' @@ -1205,7 +1239,8 @@ currentDate.setDate(currentDate.getDate()+1); } } else{ - option.legend.data = this.Selectedcul; + let legend=this.convertname(this.Selectedcul); + option.legend.data = legend; if(this.gap == 'year'){ let datas = this.mytable; datas.sort((a,b) => new Date(a[this.srow2]) - new Date(b[this.srow2])) @@ -1236,7 +1271,7 @@ currentDate.setDate(currentDate.getDate()+1); ydata.push(Number(0)); } option.series.push({ - name: now_i, + name: legend(this.Selectedcul.indexOf(now_i)), type: this.stype, emphasis: { focus: 'series' @@ -1290,7 +1325,7 @@ currentDate.setDate(currentDate.getDate()+1); )break; } option.series.push({ - name: now_i, + name: legend[this.Selectedcul.indexOf(now_i)], type: this.stype, emphasis: { focus: 'series' @@ -1349,7 +1384,7 @@ currentDate.setDate(currentDate.getDate()+1); )break; } option.series.push({ - name: now_i, + name: legend[this.Selectedcul.indexOf(now_i)], type: this.stype, emphasis: { focus: 'series' @@ -1414,10 +1449,9 @@ currentDate.setDate(currentDate.getDate()+1); } } else{ - // console.log(this.Selectedcul); - option.legend.data = this.Selectedcul; + let legend=this.convertname(this.Selectedcul); + option.legend.data = legend; for(let now_i of this.Selectedcul){ - option.legend.data = this.SelectedName; let datas = this.mytable; datas.sort((a,b) => Number(a[this.srow]) - Number(b[this.srow])); let sta = Number(datas[0][this.srow]); @@ -1444,7 +1478,7 @@ currentDate.setDate(currentDate.getDate()+1); ri += k; } option.series.push({ - name: now_i, + name: legend[this.Selectedcul.indexOf(now_i)], type: this.stype, emphasis: { focus: 'series' @@ -1455,6 +1489,12 @@ currentDate.setDate(currentDate.getDate()+1); } } } + else if (this.selectedEntity=='entity4') + { + console.log(123) + option=this.generateOptions(counts); + console.log(option) + } } else if (this.stype === 'pie') { const data = Object.entries(counts).map(([name, value]) => ({ value, name })); option = { @@ -1475,35 +1515,9 @@ currentDate.setDate(currentDate.getDate()+1); xAxis: { show: false }, // 不显示区间横轴 }; } - } - else{ - option = { - legend: {}, - tooltip: {}, - toolbox: { - feature: { - dataView: { show: true, readOnly: false }, - restore: { show: true }, - saveAsImage: { show: true } - } - }, - dataset: { - source: counts - }, - xAxis: [ - { type: 'category', gridIndex: 0 }, - { type: 'category', gridIndex: 1 } - ], - yAxis: [{ gridIndex: 0 }, { gridIndex: 1 }], - grid: [{ bottom: '55%' }, { top: '55%' }], - series: this.generateSeries(counts) -}; - } - if (this.selectedEntity=='entity4') - { - option=this.generateOptions(counts); - // console.log(option) - } + + + this.chartInstance.setOption(option); }catch(error) { @@ -1617,13 +1631,9 @@ currentDate.setDate(currentDate.getDate()+1); setTimeout(()=>this.drawChart(counts),500); }else if(this.selectedEntity=='entity4'){ let counts=this.do_entity4(); - // console.log(counts) setTimeout(()=>this.drawChart(counts),500); } - else if (this.selectedEntity=='entity5'){ - const counts=this.count_sum_time(); - // console.log(counts) - setTimeout(()=>this.drawChart(counts),500);} + else { this.$message.warning('请选择实体'); }