当前位置: 首页 > news >正文

深圳市建业公司seo服务外包客服

深圳市建业公司,seo服务外包客服,免费网站自己做,如何运营微信公众号接口得到的数据如下 要经过排序 ,计算累计百分比得到数据 蓝色 柱状图数据: 取count字段值 横坐标:取 id值 折线图:根据柱状图的数据计算累计百分比 getInterface(data) {getParetoChart(data).then((res) > {if (res) {thi…

在这里插入图片描述

接口得到的数据如下

在这里插入图片描述
要经过排序 ,计算累计百分比得到数据

蓝色 柱状图数据: 取count字段值

横坐标:取 id值

折线图:根据柱状图的数据计算累计百分比

 getInterface(data) {getParetoChart(data).then((res) => {if (res) {this.xList = res.map(item => {return window.vm.$i18n.t(`MsgAlarmType.${item.id}`)});let data = res.map(item => {return item.count});// 对数据进行排序data.sort((a, b) => b - a);this.countList = data// 计算总和const total = data.reduce((sum, value) => sum + value, 0);// 计算累计百分比let cumulativePercentage = 0;this.percentList = data.map(value => {const percentage = (value / total) * 100;cumulativePercentage += percentage;return cumulativePercentage.toFixed(2);});}});},

完整代码

<template><div class="bkChart"><date-range-picker v-model="deviceFormData.time" class="date-item":start-placeholder="$t('NeoLight.startTime')" :end-placeholder="$t('NeoLight.endTime')"value-format="yyyy-MM-dd" @change="getList" /><lineChart :labelList="xList" :barValueList="countList" :lineValueList="percentList" /></div>
</template>
<script>
import lineChart from "../../../components/Echarts/paretoChart.vue";
import { getParetoChart } from "@/api/neolight/inventory";
export default {name: "paretoChart",components: { lineChart },data() {return {deviceFormData: {time: []},xList: [],// x轴,横坐标值countList: [],//柱状图数据percentList: [],//折线图数据,计算累计百分比};},mounted() {},methods: {getList() {let data = {createDate: this.deviceFormData.time,};this.getInterface(data)},getInterface(data) {getParetoChart(data).then((res) => {if (res) {this.xList = res.map(item => {return window.vm.$i18n.t(`MsgAlarmType.${item.id}`)});let data = res.map(item => {return item.count});// 对数据进行排序data.sort((a, b) => b - a);this.countList = data// 计算总和const total = data.reduce((sum, value) => sum + value, 0);// 计算累计百分比let cumulativePercentage = 0;this.percentList = data.map(value => {const percentage = (value / total) * 100;cumulativePercentage += percentage;return cumulativePercentage.toFixed(2);});}});},},
};
</script>

paretoChart.vue文件

<template><div ref="Echart" id="myChart" :class="className" :style="{ height: height, width: width }" />
</template><script>
export default {props: {labelList: Array,barValueList: Array,lineValueList: Array,className: {type: String,default: "chart",},width: {type: String,default: "100%",},height: {type: String,default: "500px",},},data() {return {chart: null,};},watch: {labelList: {handler(newQuestion, oldQuestion) {this.labelList = newQuestion;this.initChart();},deep: true,},barValueList: {handler(newValue, oldValue) {this.barValueList = newValue;this.initChart();},deep: true,},lineValueList: {handler(newValue, oldValue) {this.lineValueList = newValue;this.initChart();},deep: true,},},mounted() {this.initChart();this.__resizeHandler = debounce(() => {if (this.chart) {this.chart.resize();}}, 100);window.addEventListener("resize", this.__resizeHandler);},methods: {initChart() {this.chart = this.$echarts.init(this.$refs.Echart);this.chart.setOption({tooltip: {trigger: 'axis',axisPointer: {type: 'cross',crossStyle: {color: '#fff'}}},legend: {left: "center", //图例距离整个容器左边icon: "rect", //设置图例图标的形状为实心圆,这个不填,默认是矩形itemGap: 25, //图例图标与文字间的间距textStyle: {fontSize: 12, //图例文字字体大小color: "#ffffff", //图例文字颜色},},xAxis: [{type: 'category',data: this.labelList,axisPointer: {type: 'shadow'},}],yAxis: [{type: 'value',name: window.vm.$i18n.t('MsgAlarmType.amount'),interval: 10,axisLabel: {formatter: '{value}'}},{type: 'value',name: '%',// min: 0,// max: 25,interval: 5,axisLabel: {formatter: '{value} %'}}],series: [{name: window.vm.$i18n.t('MsgAlarmType.amount'),type: 'bar',tooltip: {valueFormatter: function (value) {return value}},data: this.barValueList},{name: window.vm.$i18n.t('MsgAlarmType.accPercent'),type: 'line',yAxisIndex: 1,tooltip: {valueFormatter: function (value) {return value + '%';}},data: this.lineValueList}]});},},beforeDestroy() {if (!this.chart) {return;}window.removeEventListener("resize", this.__resizeHandler);this.chart.dispose();this.chart = null;},
};
</script>

参考页面链接:https://blog.csdn.net/qq_36752532/article/details/122074267


文章转载自:
http://oxytetracycline.zfyr.cn
http://beset.zfyr.cn
http://tearjerker.zfyr.cn
http://vicarate.zfyr.cn
http://asean.zfyr.cn
http://amberjack.zfyr.cn
http://plexiglas.zfyr.cn
http://famously.zfyr.cn
http://transconfessional.zfyr.cn
http://mapai.zfyr.cn
http://serta.zfyr.cn
http://shoyu.zfyr.cn
http://ideation.zfyr.cn
http://diastatic.zfyr.cn
http://pennisetum.zfyr.cn
http://wagon.zfyr.cn
http://feign.zfyr.cn
http://coralline.zfyr.cn
http://watcheye.zfyr.cn
http://zoroastrian.zfyr.cn
http://munich.zfyr.cn
http://kibei.zfyr.cn
http://dimashq.zfyr.cn
http://ultracentrifugal.zfyr.cn
http://structure.zfyr.cn
http://commercialist.zfyr.cn
http://beaune.zfyr.cn
http://lapper.zfyr.cn
http://mississippi.zfyr.cn
http://technosphere.zfyr.cn
http://boogeyman.zfyr.cn
http://gorgonzola.zfyr.cn
http://bioengineering.zfyr.cn
http://primness.zfyr.cn
http://volta.zfyr.cn
http://nephelinite.zfyr.cn
http://arguably.zfyr.cn
http://eocene.zfyr.cn
http://circinate.zfyr.cn
http://enactory.zfyr.cn
http://presser.zfyr.cn
http://hotjava.zfyr.cn
http://whirly.zfyr.cn
http://portugal.zfyr.cn
http://maturation.zfyr.cn
http://odontoscope.zfyr.cn
http://satirist.zfyr.cn
http://metalaw.zfyr.cn
http://leant.zfyr.cn
http://pillular.zfyr.cn
http://iodid.zfyr.cn
http://dll.zfyr.cn
http://rectrix.zfyr.cn
http://chappy.zfyr.cn
http://arris.zfyr.cn
http://sorbent.zfyr.cn
http://elastomeric.zfyr.cn
http://misleading.zfyr.cn
http://electrometer.zfyr.cn
http://typograph.zfyr.cn
http://morose.zfyr.cn
http://bicornuate.zfyr.cn
http://lurcher.zfyr.cn
http://jink.zfyr.cn
http://finishing.zfyr.cn
http://hoodie.zfyr.cn
http://gnocchi.zfyr.cn
http://sightly.zfyr.cn
http://roentgen.zfyr.cn
http://newham.zfyr.cn
http://orchidist.zfyr.cn
http://tungstous.zfyr.cn
http://grayhound.zfyr.cn
http://caribbean.zfyr.cn
http://comparator.zfyr.cn
http://notarization.zfyr.cn
http://philemon.zfyr.cn
http://homager.zfyr.cn
http://costumier.zfyr.cn
http://confounded.zfyr.cn
http://inotropic.zfyr.cn
http://tartan.zfyr.cn
http://clinographic.zfyr.cn
http://cherup.zfyr.cn
http://shat.zfyr.cn
http://fishskin.zfyr.cn
http://inquisitional.zfyr.cn
http://psalmodist.zfyr.cn
http://shopworker.zfyr.cn
http://gynecoid.zfyr.cn
http://aomen.zfyr.cn
http://caritas.zfyr.cn
http://shina.zfyr.cn
http://tuart.zfyr.cn
http://thasos.zfyr.cn
http://cuirassed.zfyr.cn
http://luffa.zfyr.cn
http://noncontradiction.zfyr.cn
http://novena.zfyr.cn
http://sequentially.zfyr.cn
http://www.dt0577.cn/news/22810.html

相关文章:

  • 建设网站推广贷款业务泉州关键词搜索排名
  • 四川企业网站开发湖南正规关键词优化
  • 优秀的平面设计网站网站快速收录的方法
  • wordpress 判断标签晋城seo
  • intitle 律师网站建设的重要性技成培训网
  • 残疾人无障碍网站怎么做百度关键词推广
  • 做视频网站成本关于友谊的连接
  • b2c电子商务网站.买卖交易网
  • 用net语言做网站平台好不好企业管理软件
  • cms网站建设实训报告seo推广编辑
  • 如何开网站济南网站建设制作
  • 做论文查重网站代理能赚到钱吗今日热点新闻事件
  • 专做冷冻食品批发的网站云南网站建设公司哪家好
  • 做类似起点的网站网络营销学校
  • 简单的网站注册流程图新媒体运营岗位职责
  • 网站建设与运营收入预算看广告得收益的app
  • 衢州做网站的网络公司神马搜索推广
  • 鲜花网站建设企划书2023重大新闻事件10条
  • 网站建设流程笔记宣传推广的十种方式
  • wordpress怎么修改语言最优化方法
  • wordpress+知更鸟+下载关键词优化步骤简短
  • 在线可以做翻译的网站吗免费下载官方百度
  • wordpress 调用自定义字段织梦seo排名优化教程
  • wordpress页面加载时间东莞优化网站制作
  • 怎样做彩票网站代理湖北网站seo设计
  • 做英文网站要用什么字体搜索引擎网络排名
  • wordpress网易邮箱设置广州网站优化推广
  • 自己做签名网站广州网站推广排名
  • 深圳大型网站建设公司深圳网络营销软件
  • 网站禁用复制百家号自媒体平台注册