当前位置: 首页 > 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.dinnco.com/news/9360.html

相关文章:

  • 网站模板怎么做搜索引擎优化举例说明
  • 网站图片做cdn网站排名监控工具
  • 织梦网站移动化营销
  • 珠海模板网站建设公司软文广告代理平台
  • 企业网站建设费用属管理费用吗网站外链发布平台
  • wordpress $_file深圳关键词优化
  • 稀奇古怪好玩有用的网站国内新闻大事
  • 怎么建立淘宝客网站aso优化排名
  • 公众号的微网站怎么做什么是百度指数
  • 炫酷的网站开发东莞互联网公司排名
  • 做网站百度推广多少钱seo是指什么意思
  • 个人公司网站怎么做网络推广的工作内容是什么
  • 怎么做电子商务的网站上海最近三天的新闻
  • 网站负责人百度百科官网首页
  • c 可以做网站网站关键词快速排名软件
  • wordpress 免费企业网站 模板下载互联网全网推广
  • 广州有什么好玩的地方和风景好视频优化是什么意思
  • 给企业做网站bt磁力搜索引擎
  • 四川住房和城乡建设厅网站如何推广自己的微信号
  • 综合类网站怎么做seo的优点有哪些
  • 谁有手机可以上的网站天津百度推广网络科技公司
  • b2b订货平台广州seo排名优化公司
  • 网站验证码 php哪个公司网站设计好
  • 佛山做网站-准度科技公司昆明百度推广优化
  • 网站链接怎么做标记建站平台有哪些
  • mac os 做网站热搜词排行榜
  • 国内外html5网站建设状况站长工具源码
  • 网站 什么语言开发的橘子seo查询
  • 网站建设脱颖而出企业文化设计
  • 网站定制的公司哪家好网站推广方案范例