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

有域名怎么建立网站百度贴吧的互动社区

有域名怎么建立网站,百度贴吧的互动社区,网站开发后台数据库怎么搞,怎么学网站设计基于 Echarts 框架的组件#xff0c;用于实现数据滚动效果。在该组件中#xff0c;我们首先引入了 Echarts 库#xff0c;并定义了组件的名称和所需的 props 属性。在 mounted 钩子函数中#xff0c;我们调用 initChart 方法来初始化图表#xff0c;并使用 setInterval 定…         基于 Echarts 框架的组件用于实现数据滚动效果。在该组件中我们首先引入了 Echarts 库并定义了组件的名称和所需的 props 属性。在 mounted 钩子函数中我们调用 initChart 方法来初始化图表并使用 setInterval 定时器来触发 updateChart 方法以实现数据滚动效果。在 updateChart 方法中我们通过复制数据、移除数据、截取数据等操作来更新图表并计算出当前数据索引。最后我们使用 setOption 方法来更新图表的数据和配置实现数据的滚动更新效果。 主要使用了 Echarts 提供的多个配置项和方法如设置 grid 网格、title 标题、tooltip 工具提示、legend 图例、toolbox 工具箱、xAxis 和 yAxis 坐标轴、series 数据系列等。同时我们还使用了 Echarts 提供的 LinearGradient 渐变色工具和 label 标签样式等特性来美化图表。 组件使用实例 lineDoubleEcharts :datavalues :x-datatimes / script import lineDoubleEcharts from /components/lineDoubleEcharts.vue; //其他写法省略 components: {Head,lineDoubleEcharts}, data () {return {times: [],// times: [2023-12-16 09:30:00],values: [[12.34, 25.24, 24.12, 12.44, 15.74, 22.23, 12.34, 23.24, 24.12, 12.44, 15.74],[16.44, 11.34, 18.54, 34.11, 17.54, 22.42, 33.44, 12.34, 15.54, 34.11, 17.54]],totalvalues: []}}, /script 组件内写法 templatediv classecharts-componentdiv refchart classchart/div!-- 用于渲染echarts图表的容器 --/div /template import * as echarts from echarts; export default {name: EchartsComponent,props: {data: {type: Array,required: true,},xData: {type: Array,required: true,},},data () {return {currentIndex: 0, // 当前数据索引};},mounted () {this.initChart();},watch: {data: {handler () {this.currentIndex 0; // 数据改变时重置索引},deep: true,},},methods: {initChart () {this.chart echarts.init(this.$refs.chart);let colors [#1dacfe, #FF3838, #ffd300]this.chartOption {grid: {left: 7%,right: 7%%,top: 25%,bottom: 20%,},title: {show: false},tooltip: {trigger: axis,axisPointer: {type: shadow}},legend: {left: right,textStyle: {color: #fff,},data: [1, 2],},toolbox: {show: false,},xAxis: {type: category,boundaryGap: false,show: true,axisTick: {show: false},axisLabel: {fontSize: 15,color: #d0d0d0,margin: 8,interval: 0,},axisLine: {lineStyle: {type: solid,color: #4e608b,//左边线的颜色width: 1//坐标线的宽度}},data: this.xData,},yAxis: {type: value,scale: true,name: ,axisLine: {show: false},splitNumber: 4,axisTick: {show: false},splitLine: {lineStyle: {// 使用深浅的间隔色color: #4e608b}},axisLabel: {fontSize: 13,color: #d0d0d0,margin: 12,},max: Math.max(...[]),min: 0,boundaryGap: [0.2, 0.2]},series: [{name: 1,type: line,label: {normal: {show: true,position: top,textStyle: {color: colors[0]}}},itemStyle: {normal: {color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{offset: 0,color: colors[0] // 0% 处的颜色}, {offset: 1,color: colors[0] // 100% 处的颜色}], false)}},barWidth: 15%,yAxisIndex: 0,data: [],},{name: 2,type: line,label: {normal: {show: true,position: top,textStyle: {color: colors[1]}}},itemStyle: {normal: {color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{offset: 0,color: colors[1] // 0% 处的颜色}, {offset: 1,color: colors[1] // 100% 处的颜色}], false)}},barWidth: 15%,yAxisIndex: 0,data: [],},],};this.chart.setOption(this.chartOption);// 实现数据滚动效果setInterval(() {this.updateChart();}, 2000);},updateChart () {const newData this.data.slice(); // 复制数据// 将移除的数据添加到结尾newData[0].push(newData[0].shift());newData[1].push(newData[1].shift());// 计算截取数据的开始索引和结束索引const startIndex this.currentIndex;const endIndex startIndex 10; // 每次显示10条数据const displayData [newData[0].slice(startIndex, endIndex), newData[1].slice(startIndex, endIndex)];this.chartOption.series[0].data displayData[0];this.chartOption.series[1].data displayData[1];this.chart.setOption(this.chartOption);// 更新当前数据索引this.currentIndex;if (this.currentIndex newData[0].length) {this.currentIndex 0;}},}, }; style scoped .echarts-component {width: 100%;height: 100%; }.chart {width: 100%;height: 100%; } /style 主要实现了一个使用echarts库创建的Vue组件用于展示折线图。其中通过props接收data和xData作为图表的数据来源通过watch监听data的变化并重置currentIndex当前数据索引的值。在mounted钩子函数中调用initChart()方法进行图表的初始化。initChart()方法初始化echarts实例并设置图表的配置项和数据然后通过setInterval定时更新图表的数据展示效果updateChart()方法用于更新图表的数据。最后使用style scoped对样式进行了限定使其仅在当前组件中生效。 个人主页SHOW科技公众号SHOW科技 ‍♂️ 作者简介2020参加工作专注于前端各领域技术共同学习共同进步一起加油呀 优质专栏前端主流技术分享 资料领取前端进阶资料可以找我免费领取 摸鱼学习交流我们的宗旨是在「工作中摸鱼摸鱼中进步」期待大佬一起来摸鱼 ———————————————— 版权声明本文为CSDN博主「SHOW科技」的原创文章遵循CC 4.0 BY-SA版权协议转载请附上原文出处链接及本声明。
http://www.pierceye.com/news/789752/

相关文章:

  • 旅游网站建设 策划书销售app哪个好用
  • 建个大型网站要多少钱wordpress页眉设置
  • 浅谈网站建设开发浙江中联建设集团网站
  • 哪有做网站全包圆装修公司
  • 邵阳建设银行网站是多少建设银行 企业
  • 网站开源系统网页制作与网站建设思维导图
  • 专门做前端项目的一些网站wordpress 朋友圈插件
  • 网站建设哪家专业网站开发费用怎么做账
  • 用dw怎么做网站首页wordpress 文章页面失败
  • 郑州网站制作专业乐云seowordpress it博客主题
  • 支付宝手机网站支付二维码怎么做网站 开发
  • 教育网站制作视频代理网址ag80hncom
  • 泰兴公司做网站建设制作外贸网站公司
  • 手机wap网站大全作品提示优化要删吗
  • 郑州网站建设技术支持云南澄江县建设局网站
  • wordpress建企业网站设置网站一级域名和二级域名
  • 云南省城乡与住房建设厅网站合肥网红打卡地
  • 用dw做的企业网站宁波seo优化费用
  • 网站制作开发建网站公司 蓝纤科技
  • 怎样到国外做合法网站法网站网站建设小组实验报告
  • DNF做钓鱼网站网站建设方案书编写
  • 提高网站粘性wordpress tag中文
  • 公司已有网站 如何自己做推广wordpress的音乐插件怎么用
  • 权威网站php wordpress 等
  • 建设网站企业公司中通建设计院第四分公司网站
  • 快站免费网站建设哪家好南宁市住房建设局网站
  • 学生做的网站成品roseonly企业网站优化
  • 台前网站建设电话百度账号注册申请
  • 政和县建设局网站公告征婚网站咋做
  • 做网站需要用到的语言注册公司需要多少钱保证金