| | |
| | | handler(newval, oldval) { |
| | | if (newval) { |
| | | const series = newval.map((data, index) => ({ |
| | | name: index === 0 ? "总量" : "新增", |
| | | type: "line", |
| | | name: index === 0 ? '总量' : '新增', |
| | | type: 'line', |
| | | smooth: true, |
| | | stack: "Total", |
| | | stack: index === 0 ? 'Total' : 'total2', // 根据 index 区分总量和新增的堆叠情况 |
| | | label: { |
| | | show: true, |
| | | position: "top" |
| | | textStyle: { |
| | | fontSize: 14 |
| | | } |
| | | }, |
| | | data: data.map(value => ({value})) |
| | | })); |
| | |
| | | } |
| | | } |
| | | }, |
| | | chartName:{ |
| | | handler(newval,oldval){ |
| | | if(newval){ |
| | | chartName: { |
| | | handler(newval, oldval) { |
| | | if (newval) { |
| | | this.chartOptions.title.text = newval + "数据统计" |
| | | } |
| | | }, |
| | | immediate:true, |
| | | deep:true |
| | | immediate: true, |
| | | deep: true |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['总量', '新增'] |
| | | data: ['总量', '新增'], |
| | | textStyle: { |
| | | fontSize: 14 // 调整字体大小 |
| | | } |
| | | }, |
| | | xAxis: { |
| | | boundaryGap: true, |
| | | type: 'category', |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | type: 'value', |
| | | }, |
| | | series: [] |
| | | } |