位置: IT常识 - 正文

vue中Echarts使用动态数据的两种实现方式(vuejs echarts)

编辑:rootadmin
这篇文章主要介绍了vue中Echarts使用动态数据的两种实现方式,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教 目录

推荐整理分享vue中Echarts使用动态数据的两种实现方式(vuejs echarts),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:vue中的echarts,echarts vue,vuejs echarts,vue-echarts,vue-echarts,vue echarts,vue中echarts怎么用,vuejs echarts,内容如对您有帮助,希望把文章链接给更多的朋友!

Echarts使用动态数据的两种方式1.通过computed2.在data中定义optionvue Echarts几种常用图表动态数据切换1.柱状图2.平滑折线面积图3.折线图堆叠4.饼状图Echarts使用动态数据的两种方式

在使用Echarts时我们数据一般不是静态写死的,而是通过后端接口动态获取的,在此总结两种在vue框架下Echarts使用动态数据的方式。

1.通过computedcomputed: {    options() {      let that = this;      let option = {          tooltip : {            trigger: 'axis',            formatter: function(item) {              return `支付金额 ${item[0].value}元`            }          },          legend: {            formatter: function(item){              return `${item}: ${that.priceData.todayPrice}`            }          },          grid: {              left: '3%',              right: '4%',              bottom: '3%',              containLabel: true          },          xAxis: {              type: 'category',              boundaryGap: false,              data: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24]          },          yAxis: {              type: 'value',              splitLine: { //网格线                show: false              }          },          series: [{              data: that.priceData.timePriceRange,              type: 'line',              smooth: true,              name: '支付金额',              itemStyle : {                                normal : {                  color: '#13CE66',                                    lineStyle:{                                        color:'#13CE66'                                    }                                }                            }          }]      }      return option;    }  },//初始化initEcharts(){      let  myChart = Echarts.init(this.$refs.chart);      myChart.setOption(this.options);    }2.在data中定义option

通过在初始化之前,直接改变option对应属性值

//在data中定义optioninitEcharts(){      this.option.yAxis[1].max = this.maxRate;      this.option.xAxis.data = this.dateList;      this.option.series[0].data = this.payPriceTrendList;      let  myChart = Echarts.init(this.$refs.chart);      myChart.setOption(this.option);    }

数据变化后需要再次调init方法刷线图表

vue Echarts几种常用图表动态数据切换

几种常用图表

1.柱状图

效果图

代码片段

HTML部分:

<div ref="echartMain1" id="echart-main"></div>

JS部分:

getEchartData() {this.$http.post("/sys/currency/twelvemonthstatistic", {traddingOrgId:id,}).then(({ data }) => {//示例数据data=[{"ym": "2021-06","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2021-07","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2021-08","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2021-09","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2021-10","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2021-11","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2021-12","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2022-01","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2022-02","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2022-03","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2022-04","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0},{"ym": "2022-05","countOrder": 0,"sumGuaranteeFee": 0,"sumBzjAmount": 0,"sumGuaranteeFeeToWanYuan": 0,"sumBzjAmountToWanYuan": 0}]data.forEach((value, index) => {this.chartDate.push(value.ym);//X轴月份this.chartData.push(value.countOrder);//Y轴数量});this.echart();});},echart() {var myChart = echarts.init(this.$refs.echartMain1);let option = {xAxis: [{type: "category",data: this.chartDate,axisPointer: {type: "shadow",},},],yAxis: [{type: "value",name: "近12个月的出函数量(笔)",min: 0,max: 500,interval: 100,axisLabel: {formatter: "{value}",},},],series: [{data: this.chartData,type: "bar",},],};// echarts图表自适应myChart.setOption(option);window.addEventListener("resize", () => {myChart.resize();});},2.平滑折线面积图

效果图

vue中Echarts使用动态数据的两种实现方式(vuejs echarts)

代码片段

HTML部分:

<el-row :gutter="20" class="tittle"><el-col :span="16"><div class="text1">近12月保函数据</div></el-col><!-- <el-col :span="2"><div :class="{active:isActive2===1}" @click="getDataMon12(1)" class="cursor-pointer">保函数量</div></el-col><el-col :span="2"><div :class="{active:isActive2===2}" @click="getDataMon12(2)" class="cursor-pointer">保费收入</div></el-col><el-col :span="2"><div :class="{active:isActive2===3}" @click="getDataMon12(3)" class="cursor-pointer">担保金额</div></el-col> --></el-row><div ref="echartDemo1" class="chart-box"></div>

JS部分:

/*** 获取面积折线图 filterType 1保函数量 2保费收入 3担保金额 不传返回所有*/getDataMon12(filterType) {if (filterType) {this.isActive2 = filterType;// console.log('filterType高亮的是:',filterType,this.isActive2);}var monTop121 = [];var monTop122 = [];var monTop123 = [];var dataTop121 = [];var dataTop122 = [];var dataTop123 = [];this.$http.post("/sys/data/twelvemonthstatistic", {dataType: 1,filterType: filterType}).then(res => {// console.log("面积折线图数据是:", res.data);res.data.forEach((value, index) => {if (filterType == 1) {monTop121.push(value.ym);dataTop121.push(value.countOrder);} else if (filterType == 2) {monTop122.push(value.ym);dataTop122.push(value.sumGuaranteeFeeToWanYuan);} else if (filterType == 3) {monTop123.push(value.ym);dataTop123.push(value.sumBzjAmountToWanYuan);}});if (filterType == 1) {this.initChartBar1(monTop121, dataTop121);} else if (filterType == 2) {this.initChartBar1(monTop122, dataTop122);} else if (filterType == 3) {this.initChartBar1(monTop123, dataTop123);}});},/*** 面积折线图*/initChartBar1(mon, data) {var option = {tooltip: {trigger: "axis"},title: {subtext: "保函数量(件)",left: "5%",top: "0%",textAlign: "center"},xAxis: {type: "category",boundaryGap: false,data: mon},yAxis: {type: "value"},series: [{data: data,type: "line",smooth: true,areaStyle: {}}]};this.chartBar1 = echarts.init(this.$refs.echartDemo1);this.chartBar1.setOption(option);window.addEventListener("resize", () => {this.chartBar1.resize();});},

css部分:

// 选中时的样式.active {color: #00a950;}3.折线图堆叠

效果图

代码片段

HTML部分:

<el-row :gutter="20" class="tittle"><el-col :span="16"><div class="text1">近12月保函数据</div></el-col><!-- <el-col :span="2"><div :class="{active:isActive2===1}" @click="getDataMonLine(1)" class="cursor-pointer">保函数量</div></el-col><el-col :span="2"><div :class="{active:isActive2===2}" @click="getDataMonLine(2)" class="cursor-pointer">保费收入</div></el-col><el-col :span="2"><div :class="{active:isActive2===3}" @click="getDataMonLine(3)" class="cursor-pointer">担保金额</div></el-col> --></el-row><div ref="echartDemo2" class="chart-box"></div>

JS部分:

/*** 获取层叠折线图 filterType 1保函数量 2保费收入 3担保金额 不传返回所有*/getDataMonLine(filterType) {if(filterType){this.isActive2=filterType// console.log('filterType高亮的是:',filterType,this.isActive2);}var monTop121 = [];var monTop122 = [];var monTop123 = [];var dataTop121 = [];var dataTop122 = [];var dataTop123 = [];this.$http.post("/sys/data/guaranteeorgtwelvemonthstatistic", {dataType: 1,filterType:filterType,}).then((res) => {// console.log("折线图数据/投标保函按月统计表格数据是:", res.data);this.twelvemonthDataLine = res.data;// 示例数据// this.twelvemonthDataLine=[// { detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 4, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],// ym: "2021-06"},// {detailList: [// {countOrder: 20, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 9, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 1, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],// ym: "2021-07"},// {detailList: [// {countOrder: 6, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 0, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 1, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 1, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],// ym: "2021-08"},// {detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 4, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 1, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],// ym: "2021-09"},// {detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 4, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2021-10"},// {detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 1, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2021-11"},// {detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 0, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2021-12"},// {detailList: [// {countOrder: 12, guaranteeOrgName: "08担保"},// {countOrder: 4, guaranteeOrgName: "01担保"},// {countOrder: 4, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 7, guaranteeOrgName: "06担保"},// {countOrder: 3, guaranteeOrgName: "06担保"},// {countOrder: 1, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2022-01"},// {detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 0, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2022-02"},// {detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 0, guaranteeOrgName: "01担保"},// {countOrder: 0, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2022-03"},// {detailList: [// {countOrder: 0, guaranteeOrgName: "08担保"},// {countOrder: 6, guaranteeOrgName: "01担保"},// {countOrder: 0, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 1, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2022-04"},// {detailList: [// {countOrder: 3, guaranteeOrgName: "08担保"},// {countOrder: 13, guaranteeOrgName: "01担保"},// {countOrder: 0, guaranteeOrgName: "中原银行股份有限公司"},// {countOrder: 0, guaranteeOrgName: "07担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "06担保"},// {countOrder: 0, guaranteeOrgName: "河南华诚工程担保有限公司"},// {countOrder: 0, guaranteeOrgName: "长安责任保险股份有限公司"},// {countOrder: 0, guaranteeOrgName: "阳光保险"},// {countOrder: 0, guaranteeOrgName: "中联银"},// {countOrder: 0, guaranteeOrgName: "汇友保险"},// {countOrder: 0, guaranteeOrgName: "02担保"},// ],ym: "2022-05"}// ]this.twelvemonthDataLine.forEach((value, index) => {if (filterType == 1) {monTop121.push(value.ym);dataTop121.push(value.detailList);}else if (filterType == 2) {monTop122.push(value.ym);dataTop122.push(value.sumGuaranteeFeeToWanYuan);} else if (filterType == 3) {monTop123.push(value.ym);dataTop123.push(value.sumBzjAmountToWanYuan);}});if (filterType == 1) {this.initChartLine(monTop121, dataTop121)} else if (filterType == 2) {this.initChartLine(monTop122, dataTop122);} else if (filterType == 3) {this.initChartLine(monTop123,dataTop123);}});},/*** 层叠折线图*/initChartLine(mon, data) {// console.log('monTop121:',mon);let series = [];let leggend = [];for (let i = 0; i < data.length; i++) {let countOrders = [];leggend.push(data[i].guaranteeOrgName);// countOrders=[0,1,5,2,4,5,3,1,4,9,14,2]var arr = data[i];arr.forEach((item, index) => {countOrders.push(item.countOrder);});// 将数据组装到series数组,供option配置使用series.push({// 每个担保机构,对应一条折线图name: data[i].guaranteeOrgName,type: "line",data: countOrders // 每个担保机构,对应的横坐标的值组成的数组});}console.log(leggend);console.log("series是:", series);var option = {tooltip: {trigger: "axis"},title: {subtext: "保函数量(件)",left: "5%",top: "0%",textAlign: "center"},legend: {padding: 10,tooltip: {show: true},data: leggend},xAxis: {type: "category",boundaryGap: false,data: mon},yAxis: {type: "value"},series: series};this.chartLine = echarts.init(this.$refs.echartDemo2);this.chartLine.setOption(option);window.addEventListener("resize", () => {this.chartLine.resize();});},

css部分:

// 选中时的样式.active {color: #00a950;}4.饼状图

效果图

代码片段

HTML部分:

<div class="piechart"><div class="tittle"><div class="text1">交易平台统计</div><el-date-picker v-model="![请添加图片描述](https://www.yuucn.com/wp-content/uploads/2022/11/1668831302-2fd5e645b4f2180.png)type="datetimerange" :picker-options="pickerOptions2" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:01', '23:59:59']" @change="timeHandle(4)"></el-date-picker></div><div ref="echartDemo3" class="chart-box"></div></div>

JS部分:

// 时间选择修改时数据刷新 1为投标保函按月合计 2为出函平台统计的时间选择器 3为出函机构统计的时间选择器 4为交易平台统计的时间选择器timeHandle(num) {var that = this;if (num == 1) {this.getMonthData(12, this.value1);// this.value1=""} else if (num == 2) {this.getIssuinGuarantee("", this.value2);// this.value2=""} else if (num == 3) {this.getCensusData("", this.value3);// this.value3=""} else {this.getTradeData("", this.value4);// this.value4=""}},getIssuinGuarantee(days, time) {if (days) {this.isActive3 = days;// console.log('days高亮的是:',days,this.isActive3);}this.$http({url: "/sys/data/guaranteeorgplatformstatistic",method: "post",data: {dataType: 1,days: days,startTime: !time[0] ? "" : time[0],endTime: !time[1] ? "" : time[1]}}).then(res => {// console.log("出函平台数据:", res.data);this.issuinGuaranteeData = res.data;//后台响应数据是this.issuinGuaranteeData=[{countOrder: 3countOrderRatio: 21.42sumBzjAmount: 3000sumBzjAmountRatio: 21.42sumBzjAmountToWanYuan: 0.3sumGuaranteeFee: 600sumGuaranteeFeeRatio: 10.9sumGuaranteeFeeToWanYuan: 0.06traddingOrgId: "303c3dfaa3c54864a1b67f5fee694231"traddingOrgName: "驻马店公共资源交易中心"},{countOrder: 4countOrderRatio: 28.57sumBzjAmount: 4000sumBzjAmountRatio: 28.57sumBzjAmountToWanYuan: 0.4sumGuaranteeFee: 1400sumGuaranteeFeeRatio: 25.45sumGuaranteeFeeToWanYuan: 0.14traddingOrgId: "57f2e9ceb8834fe7ac37e06f9dab7aef"traddingOrgName: "通许县公共资源交易中心"},{countOrder: 2countOrderRatio: 14.28sumBzjAmount: 2000sumBzjAmountRatio: 14.28sumBzjAmountToWanYuan: 0.2sumGuaranteeFee: 1000sumGuaranteeFeeRatio: 18.18sumGuaranteeFeeToWanYuan: 0.1traddingOrgId: "8af00e2ff8ea458da5b122495ee83303"traddingOrgName: "杞县公共资源交易中心"},{countOrder: 5countOrderRatio: 35.73sumBzjAmount: 5000sumBzjAmountRatio: 35.73sumBzjAmountToWanYuan: 0.5sumGuaranteeFee: 2500sumGuaranteeFeeRatio: 45.47sumGuaranteeFeeToWanYuan: 0.25traddingOrgId: "c83acb963a4140438984b196abcec46c"traddingOrgName: "巩义公共资源交易中心"}]this.initChartBar3(this.issuinGuaranteeData);});},/*** 3饼图*/initChartBar3(data) {var temp1 = [];var temp2 = [];var temp3 = [];data.forEach((value, index) => {temp1.push({name: value.guaranteeOrgName,value: value.countOrderRatio});temp2.push({name: value.guaranteeOrgName,value: value.sumGuaranteeFeeRatio});temp3.push({name: value.guaranteeOrgName,value: value.sumBzjAmountRatio});});// console.log(temp1)// console.log(temp2)// console.log(temp3)var option = {tooltip: {trigger: "item",formatter: "{b} : {c} ({d}%)"},title: [{subtext: "保函数量占比",left: "16.67%",top: "5%",textAlign: "center"},{subtext: "保函金额占比",left: "50%",top: "5%",textAlign: "center"},{subtext: "担保金额占比",left: "83.33%",top: "5%",textAlign: "center"}],series: [{type: "pie",radius: "55%",center: ["50%", "50%"],data: temp1,right: "66.6667%"},{type: "pie",radius: "55%",center: ["50%", "50%"],data: temp2,left: "33.3333%",right: "33.3333%"},{type: "pie",radius: "55%",center: ["50%", "50%"],data: temp3,left: "66.6667%"}]};this.chartBar3 = echarts.init(this.$refs.echartDemo3);this.chartBar3.setOption(option);window.addEventListener("resize", () => {this.chartBar3.resize();});},

css部分:

// 选中时的样式.active {color: #00a950;}---

以上为个人经验,希望能给大家一个参考,也希望大家多多支持本站。

本文链接地址:https://www.jiuchutong.com/zhishi/303688.html 转载请保留说明!

上一篇:python shell怎样在Windows打开?(python 3.4.3 shell)

下一篇:python如何二值化图像(python 二值化)

  • 个税申报的收入扣除社保吗
  • 销售企业进货会计分录
  • 普票和增值税发票的区别
  • 扣缴义务人和纳税人举例
  • 市政绿化工程的施工方案
  • 营销策划代理合同
  • 建筑业工会经费0.12% 怎么来的
  • 税控盘必须一直插着吗
  • 退土增税后账务处理
  • 企业所得税的优点有哪些
  • 信用证保证金是什么意思
  • 建筑公司运营的流程
  • 股东拿不到钱
  • 代开建安发票怎么做账务处理?
  • 老板给的钱计入什么科目
  • 小规模专票丢了怎么办
  • 新建厂房装修费账务处理
  • 应交增值税怎么做账务处理
  • 企业所得税资产总额怎么算出来的呢
  • 公司收到个人借款的现金流量
  • 旅游业企业所得税要求
  • RSync文件备份同步 Linux服务器rsync同步配置图文教程
  • biospwds最新版
  • warning control
  • 收到投标保证金利息会计分录
  • 无形资产的摊销怎么算
  • jdk1.8环境变量设置
  • 银行贷款发放怎么做凭证
  • 应收账款需要计提损失准备吗
  • yolo4损失函数
  • yolo v5详解
  • overflow常见释义
  • 基于SadTalker的AI主播,Stable Diffusion也可用
  • php如何入门
  • 税法折旧和会计折扣会计分录
  • 需要缴纳企业所得税的企业类型
  • 出口货物不予免、抵和退税为什么是按外销离岸价计算
  • 公司租赁员工电脑怎么办
  • sqlserver连接不到本地服务器
  • 从在建工程调整到费用
  • 公司购买法拍房需要交什么费
  • 一般纳税人可以开3%的发票吗
  • 企业收到收据后怎么处理
  • 房地产公司收房款怎么分录
  • 存货跌价准备可以转回吗?
  • 一次性收取房租怎么做分录
  • 其他公司借款现金怎么办
  • 公司费用分摊给各部门
  • 用友关账怎么取消
  • 印花税征税范围2021
  • 其他收入属于什么收入
  • win7 mysql5.7.21安装
  • 防止服务器断电
  • MySQL存储过程和函数有什么区别?
  • 安装win8一直卡在转圈圈
  • 预览版win10
  • xp系统怎么装机
  • 安装win7旗舰版用户名和密码是多少
  • windows10日历没有显示农历
  • pm是什么软件的缩写
  • Win10系统下怎么设置按Win+E进入计算机的图文教程
  • linux如何使用双屏
  • win7系统删除文件需要权限
  • Bullet(Cocos2dx)之交叉编译Android,集成到cocos2dx3.x
  • android数据库使用
  • python笛卡尔积
  • 利用职务之便谋取私利是什么罪
  • 如何解决eclipse非正常关闭重打开编译代码
  • unity gui教程
  • shell脚本-n
  • js原型作用
  • android缓存清理
  • 2021一带一路会议时间?
  • 税务局无编制人员工资
  • 舟山自贸区税收优惠政策五减五免
  • 陕西省税务电话是多少
  • 小微企业减半征收房产税
  • 收到发票需要代签吗
  • 浙江省国税局地址
  • 怎么查询地税信息表
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设