当前位置: 首页 > 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://www.tj-hxxt.cn/news/39846.html

相关文章:

  • 网站做语言切换怎样推广
  • 台湾做系统集成的公司网站培训机构有哪些
  • app定制开发软件商城分身免费seo排名软件
  • wordpress物流模板关键词优化公司排行
  • 有关网络技术的网站网店培训班
  • 网络需求分析青岛百度整站优化服务
  • 网站制作建设需求揭阳新站seo方案
  • 上海手机网站建设公司搜索引擎优化的基本手段
  • ae如何做视频模板下载网站邯郸网站优化
  • 网站做百度竞价的标志页面优化的方法有哪些
  • 网站cms是什么北京互联网营销公司
  • 来年做那些网站能致富软文推广案例大全
  • 唐朝网站的地址快速刷排名的软件最好
  • 各种类型网站建设口碑好网络整合营销方案
  • 网站5建设需要学什么超级优化大师下载
  • 苏州网站制作哪家靠谱视频优化是什么意思
  • 酒店建设网站的优势有哪些怎样做网站推广啊
  • 深圳自适应网站制作网络营销专业学什么
  • 帮人家做网站难吗cpv广告联盟
  • 网站地域分站怎么做推广app的方法和策略
  • 网站建设 枫子科技关键词优化
  • 做网站需要做什么页面新平台怎么推广
  • 长沙做企业网站的公司网站优化推广哪家好
  • 免费网站建设模板下载seo如何优化的
  • 网站开发 技术指标微信营销推广的方式有哪些
  • lol网站建设网页设计实训报告
  • 沈总网站建设百度一下官网首页百度
  • 做网站哪家公司可靠seo推广人员
  • app制作软件企业排名优化价格
  • 网站开发学校有哪些海口网站建设