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

凡客网站建站教程安卓优化大师hd

凡客网站建站教程,安卓优化大师hd,一个软件是怎么做出来的,东莞企业网站echarts:一个基于 JavaScript 的开源可视化图表库。 目录 效果 一、介绍 1、官方文档:Apache ECharts 2、官方示例 二、准备工作 1、安装依赖包 2、示例版本 三、使用步骤 1、在单页面引入 echarts 2、指定容器并设置容器宽高 3、数据处理&am…

 echarts:一个基于 JavaScript 的开源可视化图表库。

目录

效果

一、介绍

 1、官方文档:Apache ECharts

2、官方示例

二、准备工作

1、安装依赖包

 2、示例版本 

三、使用步骤

1、在单页面引入 ' echarts '

2、指定容器并设置容器宽高

3、数据处理(关键点)

四、完整示例

tips


效果

一、介绍

 1、官方文档:Apache ECharts

Apache EChartsApache ECharts,一款基于JavaScript的数据可视化图表库,提供直观,生动,可交互,可个性化定制的数据可视化图表。https://echarts.apache.org/zh/index.html

2、官方示例

二、准备工作

1、安装依赖包

npm install echarts --save

 2、示例版本 

"echarts": "^5.4.2",

三、使用步骤

1、在单页面引入 ' echarts '

import * as echarts from "echarts";

注:上面的代码会引入 ECharts 中所有的图表和组件,如果你不想引入所有组件,也可以使用 ECharts 提供的按需引入的接口来打包必须的组件。详见官方文档:在项目中引入 ECharts - 入门篇 - Handbook - Apache ECharts

2、指定容器并设置容器宽高

<template><div id="main"></div>
</template><script>import * as echarts from "echarts";export default {name: "mutiYAxis",data() {return {};},methods: {initChart() {let data = this.datalet chartDom = document.getElementById("main");let myChart = echarts.init(chartDom);let option;...详见完整示例   },},};
</script><style scoped>#main {width: 1000px;height: 500px;}
</style>

3、数据处理(关键点)

      let xAxisData = [];let series = [];let index = 1;let seriesNames = [];let seriesUnit = [];let yAxis = [];let timeData = [];data.sort(this.sortByLength);data.forEach((_series, i) => {let _yAxis = [];let arrEle = [];let nameUnit = '';_series.unit ? (nameUnit = '(' + _series.unit + ')') : (nameUnit = '');_series.dataList.forEach((item) => {let { value, time } = item;timeData.push(time);arrEle = [time, value];_yAxis.push(arrEle);});seriesNames.push(_series.seriesName);seriesUnit.push(_series.unit);if (yAxis.length < 2) {yAxis.push({name: _series.seriesName + nameUnit,nameTextStyle: {fontSize: 14,fontcolor: '#fff',fontWeight: 'bolder',},splitLine: {show: false},axisLabel: {formatter: '{value} ',},});}let _item = {name: _series.seriesName,type: 'line',smooth: true,showAllSymbol: false,symbol: 'emptyCircle',data: _yAxis,connectNulls: true,};if (index == 2) {_item.yAxisIndex = 1;}series.push(_item);index++;});xAxisData = this.sortByTime(timeData);

注:部分方法的完整版在完整示例展示

四、完整示例

<template><div class="multipleDiscounting"><div id="main"></div></div>
</template>
<script>
import * as echarts from "echarts";
export default {name: "multipleDiscounting",data() {return {dataArr: [{seriesName: "折现一",unit: '',dataList: [{value: 0,time: "2023-12-05 01:32:00"},{value: 0,time: "2023-12-05 02:06:50"},{value: 0,time: "2023-12-05 07:13:56"},{value: 11.5,time: "2023-12-05 07:56:06"},{value: 36.3,time: "2023-12-05 10:18:12"},{value: 51.8,time: "2023-12-05 12:34:49"},{value: 21.9,time: "2023-12-05 14:36:05"},{value: 24.2,time: "2023-12-05 15:40:00"},{value: 13.7,time: "2023-12-05 16:36:22"},{value: 0,time: "2023-12-05 17:14:31"},],},{seriesName: "折现二",unit: '',dataList: [{value: 0,time: "2023-12-05 00:28:16"},{value: 0,time: "2023-12-05 00:31:56"},{value: 0,time: "2023-12-05 02:10:56"},{value: 0,time: "2023-12-05 02:21:56"},{value: 0,time: "2023-12-05 06:50:22"},{value: 36.6,time: "2023-12-05 10:39:55"},{value: 34.1,time: "2023-12-05 10:50:55"},{value: 50.2,time: "2023-12-05 12:00:36"},{value: 25.9,time: "2023-12-05 14:36:05"},{value: 22.1,time: "2023-12-05 14:37:33"},{value: 24.9,time: "2023-12-05 15:50:10"},{value: 12.1,time: "2023-12-05 16:56:11"},{value: 9.3,time: "2023-12-05 17:15:59"}],},]};},mounted() {this.$nextTick(() => {this.initChart(this.dataArr);});},methods: {initChart(data) {let chartDom = document.getElementById("main");let myChart = echarts.init(chartDom);let option;let xAxisData = [];let series = [];let index = 1;let seriesNames = [];let seriesUnit = [];let yAxis = [];let timeData = [];data.sort(this.sortByLength);data.forEach((_series, i) => {let _yAxis = [];let arrEle = [];let nameUnit = '';_series.unit ? (nameUnit = '(' + _series.unit + ')') : (nameUnit = '');_series.dataList.forEach((item) => {let { value, time } = item;timeData.push(time);arrEle = [time, value];_yAxis.push(arrEle);});seriesNames.push(_series.seriesName);seriesUnit.push(_series.unit);if (yAxis.length < 2) {yAxis.push({name: _series.seriesName + nameUnit,nameTextStyle: {fontSize: 14,fontcolor: '#fff',fontWeight: 'bolder',},splitLine: {show: false},axisLabel: {formatter: '{value} ',},});}let _item = {name: _series.seriesName,type: 'line',smooth: true,showAllSymbol: false,symbol: 'emptyCircle',data: _yAxis,connectNulls: true,};if (index == 2) {_item.yAxisIndex = 1;}series.push(_item);index++;});xAxisData = this.sortByTime(timeData);option = {grid: {containLabel: true,},tooltip: {trigger: 'axis',borderRadius: 4,formatter: function (params) {let result = params[0].axisValueLabel;let unit = '';for (let i = 0; i < params.length; i++) {seriesUnit[i] ? (unit = seriesUnit[i]) : (unit = '');let param = params[i];result += '<br/>' + param.marker + param.seriesName + '  ' + param.value + unit;}return result;},},legend: {type: 'scroll',width: '90%',data: seriesNames,},calculable: true,xAxis: [{type: 'category',boundaryGap: false,data: xAxisData,},],yAxis,dataZoom: [{type: 'inside',},],series,};option && myChart.setOption(option);},// 根据 dataList.length 从大到小排序sortByLength(a, b) {return b.dataList.length - a.dataList.length;},// 根据 日期时间 去重 从小到大排序sortByTime(arr) {return [...new Set(arr)].map((item) => new Date(item)).sort((a, b) => a.getTime() - b.getTime()).map((time) => this.timeFormatConversion(time));},// 时间格式转换timeFormatConversion(chinaStandard) {let date = new Date(chinaStandard);let Y = date.getFullYear();let M = (date.getMonth() + 1).toString().padStart(2, '0');let D = date.getDate().toString().padStart(2, '0');let h = date.getHours().toString().padStart(2, '0');let m = date.getMinutes().toString().padStart(2, '0');let s = date.getSeconds().toString().padStart(2, '0');return `${Y}-${M}-${D} ${h}:${m}:${s}`;},},
};
</script><style lang="less" scoped>
#main {width: 1000px;height: 500px;
}
</style>

tips

1、X轴的数据一定要合并去重并排序

2、series的数据格式一定是数组嵌套数组


文章转载自:
http://dinncomelian.wbqt.cn
http://dinncokartik.wbqt.cn
http://dinncohyperalimentation.wbqt.cn
http://dinncowilt.wbqt.cn
http://dinncoparging.wbqt.cn
http://dinncoparamilitarist.wbqt.cn
http://dinncoremoval.wbqt.cn
http://dinncolayshaft.wbqt.cn
http://dinncoironmaster.wbqt.cn
http://dinncocotswolds.wbqt.cn
http://dinncodiffusion.wbqt.cn
http://dinncoacus.wbqt.cn
http://dinncooffset.wbqt.cn
http://dinncoseabeach.wbqt.cn
http://dinncodiplocardiac.wbqt.cn
http://dinncodipetalous.wbqt.cn
http://dinncoinscribe.wbqt.cn
http://dinncofascist.wbqt.cn
http://dinncofalsism.wbqt.cn
http://dinncoinset.wbqt.cn
http://dinncofemality.wbqt.cn
http://dinncojamesonite.wbqt.cn
http://dinncobrightly.wbqt.cn
http://dinncoscarey.wbqt.cn
http://dinncotopos.wbqt.cn
http://dinncodardic.wbqt.cn
http://dinncotellurize.wbqt.cn
http://dinncohexahydroxy.wbqt.cn
http://dinncohexokinase.wbqt.cn
http://dinnconightviewer.wbqt.cn
http://dinncounhysterical.wbqt.cn
http://dinncomele.wbqt.cn
http://dinncojillaroo.wbqt.cn
http://dinncocontestee.wbqt.cn
http://dinncononpositive.wbqt.cn
http://dinncounderinsured.wbqt.cn
http://dinncodilettantish.wbqt.cn
http://dinncosemiautomated.wbqt.cn
http://dinncowistfulness.wbqt.cn
http://dinncotoxaphene.wbqt.cn
http://dinncoquonset.wbqt.cn
http://dinncosql.wbqt.cn
http://dinncotenty.wbqt.cn
http://dinncoodium.wbqt.cn
http://dinncoceo.wbqt.cn
http://dinncocaravaneer.wbqt.cn
http://dinncoinadvisable.wbqt.cn
http://dinncohumanization.wbqt.cn
http://dinncocoquilla.wbqt.cn
http://dinncoalmanac.wbqt.cn
http://dinncoquibbler.wbqt.cn
http://dinncopollinical.wbqt.cn
http://dinncohyperbatic.wbqt.cn
http://dinncoformant.wbqt.cn
http://dinncofluvialist.wbqt.cn
http://dinncobowman.wbqt.cn
http://dinncomisalignment.wbqt.cn
http://dinncocrop.wbqt.cn
http://dinncohexabiose.wbqt.cn
http://dinncopetalite.wbqt.cn
http://dinncomalemute.wbqt.cn
http://dinncoapoplectic.wbqt.cn
http://dinncospherulite.wbqt.cn
http://dinncoxanthous.wbqt.cn
http://dinncohydria.wbqt.cn
http://dinncoextortionary.wbqt.cn
http://dinncokawaguchi.wbqt.cn
http://dinncoxylol.wbqt.cn
http://dinncosocker.wbqt.cn
http://dinncoirrigable.wbqt.cn
http://dinncofantastically.wbqt.cn
http://dinncowtc.wbqt.cn
http://dinncobugs.wbqt.cn
http://dinncoentirety.wbqt.cn
http://dinncofeministic.wbqt.cn
http://dinncoplanometer.wbqt.cn
http://dinncoeatery.wbqt.cn
http://dinncoimaginal.wbqt.cn
http://dinncomaryknoller.wbqt.cn
http://dinncoboer.wbqt.cn
http://dinncoshavie.wbqt.cn
http://dinncooperate.wbqt.cn
http://dinnconegation.wbqt.cn
http://dinncohorny.wbqt.cn
http://dinncotiran.wbqt.cn
http://dinncooccupancy.wbqt.cn
http://dinncocopartner.wbqt.cn
http://dinncolamprey.wbqt.cn
http://dinncotanghan.wbqt.cn
http://dinncodominica.wbqt.cn
http://dinncoseismonasty.wbqt.cn
http://dinncohatted.wbqt.cn
http://dinncoanicut.wbqt.cn
http://dinncosclerotoid.wbqt.cn
http://dinncolazily.wbqt.cn
http://dinnconettie.wbqt.cn
http://dinncosexploitation.wbqt.cn
http://dinncoepichorial.wbqt.cn
http://dinncovanadinite.wbqt.cn
http://dinncopenultima.wbqt.cn
http://www.dinnco.com/news/146772.html

相关文章:

  • 网站建设发票几个点优化大师软件大全
  • 哈尔滨建站软件网络营销的特征和功能
  • 网站推广方法100种百度seo多久能优化关键词
  • 西安大雁塔高多少米seo交流
  • 免费企业网站注册重庆发布的最新消息今天
  • 婚纱摄影网站源码aspapp数据分析软件
  • 赤峰市政府信息网站建设沈阳关键词seo排名
  • 网站从哪些方面做优化网络查询网站
  • 校园网站建设意义网站seo站长工具
  • 网站建设公司愿景永久域名查询
  • 产品推广公司seo自动发布外链工具
  • 哈尔滨市建设工程信息网官方网站移动营销
  • 佘山做网站百度文库首页官网
  • 网站监测浏览器类型淄博百度推广
  • 菠菜网站怎么做公司网站建设公司好
  • 以做网站为毕设国际新闻最新消息美国
  • 怎样批量做全国网站香蕉和忘忧草对焦虑的影响
  • 旅游网站建设普通论文软文推广多少钱
  • 阿里免费做网站女生学电子商务后悔了
  • wordpress 建购物网站搜索引擎营销概念
  • 公积金网站 如何做减员网络推广电话销售技巧和话术
  • 做笑话网站赚钱站长工具百科
  • 怎么样做网站的目录结构网页关键词优化软件
  • 没备案的网站怎么做淘客西安seo关键词推广
  • 帮站seo搜索引擎营销的实现方法有
  • 武汉做网站公司推荐网络策划是做什么的
  • 福建省建设执业继续教育网站官网建站多少钱
  • 微信公众平台怎样开发seo基础入门教程
  • 红尘资源网排名优化公司哪家效果好
  • mip wordpress模板系统优化大师免费版