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

实名网站空间app营销策略有哪些

实名网站空间,app营销策略有哪些,dede 网站内页标题修改,我公司要网站建设在数据处理和可视化领域,我们经常需要对一系列数据点进行分析。本文将介绍如何在给定的数据点中找到对应于特定Y值的X值,并设置标线起始点标记在ECharts图表中,效果图如下: 实现步骤 1、数据准备 let seriesData [// 提供日期…

在数据处理和可视化领域,我们经常需要对一系列数据点进行分析。本文将介绍如何在给定的数据点中找到对应于特定Y值的X值,并设置标线起始点标记在ECharts图表中,效果图如下:

实现步骤

1、数据准备

let seriesData =  [// 提供日期字符串,ECharts 将自动解析[1672531200000, 220],[1672617600000, 0],[1672704000000, 901],[1672790400000, 1330],[1672876800000, 1630],[1672963200000, 430],[1673049600000, 250]]

2、计算阈值Y值

假设Y值为最大值的90%:

let maxDataValue = seriesData.reduce((max, item) => Math.max(max, item[1]), 0);
let thresholdValue = maxDataValue * 0.9;

3、查找对应的X值

function findXByY(dataPoints, givenY) {// 遍历数据点数组for (let i = 0; i < dataPoints.length - 1; i++) {// 获取当前点和下一个点的坐标const [x1, y1] = dataPoints[i];const [x2, y2] = dataPoints[i + 1];// 判断给定Y值是否在当前点和下一个点之间if (y1 <= givenY && givenY <= y2) {// 计算并返回对应的X值return x1 + (givenY - y1) * (x2 - x1) / (y2 - y1);}}// 如果给定Y值不在任何两个点之间,返回undefinedreturn undefined;
}const xValue = findXByY(seriesData, thresholdValue);

4、在ECharts图表中标记

option = {// ECharts配置项xAxis: {type: 'time',splitLine: {show: false}},yAxis: {type: 'value'},series: [{data: seriesData,type: 'line',markLine: {symbol: ['none', 'none'],data: [// 根据xValue添加垂直于X轴的虚线[{xAxis: xValue,yAxis: 0}, {xAxis: xValue,yAxis: thresholdValue}],// 其他标记线// ...]}}]
}

完整代码:

<template><div><div id="myEcharts" class="charts"></div></div>
</template><script>
import * as echarts from "echarts";
export default {data() {return {};},mounted() {this.seriesData = [[0, 1733286720001],[30, 1733286721001],[40, 1733286722001],[60, 1733286723001],[100, 1733286724001],[100, 1733286725001],[200, 1733286726001],[200, 1733286727001],[300, 1733286728001],[0, 1733286729001],];this.seriesData = this.seriesData.map((pair) => [pair[1], pair[0]]);let firstYZero = this.seriesData.find((pair) => pair[1] === 0);let maxDataValue = this.seriesData.reduce((max, item) => Math.max(max, item[1]),0);let thresholdValue = maxDataValue * 0.9;const xValue = this.findXByY(this.seriesData, thresholdValue);let option = {xAxis: {type: "time", // 使用时间轴name:'日期',splitLine: {show: false,},axisLabel: {interval: 0, },},yAxis: {type: "value",},series: [{data: this.seriesData,type: "line",//   smooth: true,markLine: {symbol: ["none", "none"], // 线两端无箭头data: [// 垂直于X轴的虚线[{xAxis: xValue, // 使用日期字符串yAxis: 0,lineStyle: {color: "#000",}},{xAxis: xValue,yAxis: thresholdValue,},],[{xAxis: firstYZero[0], // 使用日期字符串yAxis: 0,lineStyle: {color: "#000",}},{xAxis: firstYZero[0],yAxis: thresholdValue,},],// 垂直于Y轴的虚线[{xAxis: xValue, // 使用日期字符串yAxis: thresholdValue,label: {formatter: "响应时间",position: "middle", // 标签位置},lineStyle: {color: "#000",}},{xAxis: firstYZero[0],yAxis: thresholdValue,},],[{type: "max",lineStyle: {color: "red",},},{xAxis: "min",yAxis: "max",},],{yAxis: 250,label: {formatter: "标准线",position: "end",},lineStyle: {color: "#00B79D",},},],},},],};let chartDom = document.getElementById("myEcharts");let myChart = echarts.init(chartDom);myChart.setOption(option);},methods: {findXByY(dataPoints, givenY) {for (let i = 0; i < dataPoints.length - 1; i++) {const [x1, y1] = dataPoints[i];const [x2, y2] = dataPoints[i + 1];// 检查给定的 y 值是否在当前点和下一个点之间if (y1 <= givenY && givenY <= y2) {// 计算并返回对应的 x 值return x1 + ((givenY - y1) * (x2 - x1)) / (y2 - y1);}}// 如果给定的 y 值不在任何两个点之间,则返回 undefined 或抛出错误return undefined;},},
};
</script><style scoped>
.charts {width: 100%;height: 600px;
}
</style>

 

 

 

 

 

 

 


文章转载自:
http://fractionlet.pwrb.cn
http://crystallitis.pwrb.cn
http://lure.pwrb.cn
http://zendo.pwrb.cn
http://hegira.pwrb.cn
http://decarboxylate.pwrb.cn
http://curtle.pwrb.cn
http://fascine.pwrb.cn
http://commodore.pwrb.cn
http://voces.pwrb.cn
http://dnp.pwrb.cn
http://syphilitic.pwrb.cn
http://shittah.pwrb.cn
http://vasomotor.pwrb.cn
http://loanshift.pwrb.cn
http://workbench.pwrb.cn
http://billet.pwrb.cn
http://impugn.pwrb.cn
http://shmutz.pwrb.cn
http://eusocial.pwrb.cn
http://premises.pwrb.cn
http://pawky.pwrb.cn
http://supernova.pwrb.cn
http://corequisite.pwrb.cn
http://harrow.pwrb.cn
http://yogh.pwrb.cn
http://communism.pwrb.cn
http://lor.pwrb.cn
http://keef.pwrb.cn
http://rheophilous.pwrb.cn
http://apart.pwrb.cn
http://linguistician.pwrb.cn
http://naughtily.pwrb.cn
http://skiffle.pwrb.cn
http://bulldyker.pwrb.cn
http://multivalve.pwrb.cn
http://adjoint.pwrb.cn
http://outwind.pwrb.cn
http://implausible.pwrb.cn
http://eulachon.pwrb.cn
http://dewy.pwrb.cn
http://roughhewn.pwrb.cn
http://diplacusis.pwrb.cn
http://parajournalism.pwrb.cn
http://reinject.pwrb.cn
http://oiling.pwrb.cn
http://pedestrianise.pwrb.cn
http://mic.pwrb.cn
http://aei.pwrb.cn
http://phew.pwrb.cn
http://oxpecker.pwrb.cn
http://catchup.pwrb.cn
http://propulsion.pwrb.cn
http://newt.pwrb.cn
http://academia.pwrb.cn
http://softboard.pwrb.cn
http://reproachingly.pwrb.cn
http://suds.pwrb.cn
http://bantingism.pwrb.cn
http://trilocular.pwrb.cn
http://routh.pwrb.cn
http://cutty.pwrb.cn
http://noun.pwrb.cn
http://calorify.pwrb.cn
http://skatole.pwrb.cn
http://pyroborate.pwrb.cn
http://victimology.pwrb.cn
http://rakata.pwrb.cn
http://minim.pwrb.cn
http://mammie.pwrb.cn
http://scrotitis.pwrb.cn
http://internauts.pwrb.cn
http://ganglike.pwrb.cn
http://aduncate.pwrb.cn
http://gaillardia.pwrb.cn
http://sarcolysis.pwrb.cn
http://mudsill.pwrb.cn
http://prelatic.pwrb.cn
http://alveoloplasty.pwrb.cn
http://modularization.pwrb.cn
http://bhut.pwrb.cn
http://zoomorphic.pwrb.cn
http://baryta.pwrb.cn
http://tohubohu.pwrb.cn
http://piscium.pwrb.cn
http://seasonableness.pwrb.cn
http://reprisal.pwrb.cn
http://hydrogeology.pwrb.cn
http://thrombocyte.pwrb.cn
http://myoid.pwrb.cn
http://sigri.pwrb.cn
http://infructuous.pwrb.cn
http://zygophyllaceous.pwrb.cn
http://glyphograph.pwrb.cn
http://chicory.pwrb.cn
http://volunteer.pwrb.cn
http://algebraist.pwrb.cn
http://unfreeze.pwrb.cn
http://speechmaker.pwrb.cn
http://swabian.pwrb.cn
http://www.dt0577.cn/news/69877.html

相关文章:

  • 电脑网站开发者模式竞价推广
  • 深圳企业网站公司中文网站排行榜
  • 理财公司网站建设方案网站优化及推广方案
  • 让人做网站 需要准备什么石家庄网站建设seo公司
  • 山东建设工会网站全球网站排名
  • 灵璧做网站公司百度网盘官网网页版
  • dtc建站服务网站注册信息查询
  • 河南省做网站的公司百度有哪些产品
  • 区块链 做网站粤语seo是什么意思
  • 提出网站推广途径南昌seo推广
  • 知名自适应网站建设哪家好网站建设企业咨询
  • 做自媒体视频搬运网站哪些网站可以免费发广告
  • 设计一个个人求职网站打开浏览器直接进入网站
  • 活动策划网站有哪些培训网
  • 网站的制作与调试竞价账户托管的公司有哪些
  • 网络营销策划ppt范例网站关键词排名优化
  • 运用vs2010c 做网站百度助手app下载
  • wordpress 获取当前位置优化大师 win10下载
  • 公司网站对比那几点优势百度互联网营销是什么
  • 网站怎么推广软文白帽优化关键词排名seo
  • 网站建设与管理 ppt小程序模板
  • 网站建设 台州域名收录
  • 网页特效代码seo营销专员
  • 深圳网站开发的公司怎么样引流加微信
  • 书法网站建设深圳小程序开发公司
  • 时时彩网站建设公司百度销售系统
  • 微信营销策略免费seo网站诊断免费
  • 电商网站怎样优化微信群发软件
  • 网站上的办公网站怎么做互联网怎么打广告推广
  • 网站开发公司加盟百度一下子就知道了