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

网站建设博客作业seo刷排名工具

网站建设博客作业,seo刷排名工具,网页设计模板html代码百度云,一级a做爰片免费网站黄背景 在实际项目中需要进行图表的绘制,虽然element提供了丰富的绘图接口,但依然不能满足实际的需求,所以需要借用echarts绘制内容更加丰富及美观的图表。 两种方法 echarts的安装方法网上有,这里就不展开了,主要介绍目…

背景

在实际项目中需要进行图表的绘制,虽然element提供了丰富的绘图接口,但依然不能满足实际的需求,所以需要借用echarts绘制内容更加丰富及美观的图表。

两种方法

echarts的安装方法网上有,这里就不展开了,主要介绍目前用到的两种方法。

采用Vue-echarts

  • 需要通过import 按需所取的倒入echarts的绘图组件
  • echarts的option存放在data中,并注册组件
<template><v-container fluid ><h1>Common Cover Material Properties Comparison </h1><v-divider/>        <v-row><v-col cols="12"><v-rowalign="stretch"justify="center"class="grey lighten-5"style="height: 400px;"><v-chart   :options="bar"/><v-chart   :options="bar"/></v-row></v-col></v-row></v-container></template>
<script>
import ECharts from "vue-echarts/components/ECharts";
import "echarts/lib/chart/bar";
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/title'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/toolbox'
export default {name: "App",components: {"v-chart": ECharts},data :function() {return {bar: {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'}},// color: ['#003366', '#006699', '#4cabce', '#e5323e','#003366'],toolbox: {show: true,orient: 'vertical',left: 'right',top: 'center',feature: {// mark: {show: true},// dataView: {show: true, readOnly: false},// magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']},// restore: {show: true},saveAsImage: {show: true}}},xAxis: [{type: 'category',axisTick: {show: false},data: ['E', 'Ro', 'Toughness_LT','Toughness_RT','Toughness_HT'],axisLabel: {textStyle: {fontSize :10}}}],yAxis: [{type: 'value',axisLabel: {textStyle: {fontSize :14}}}],title: {left: 'center',text: '应变率 100/s',},legend: {show:true,bottom: 10},series:[]}};},mounted(){this.getData()},methods: {getData() {this.$axios.get("/static/json/echart.json").then(response => {console.log(response.data);this.bar.series = JSON.parse(response.data);console.log(this.bar.series)},error => {  console.log(error);});},}}
</script>
<style>
.my-chart {width: 400px;height: 500px;
}
</style>

直接用echarts

  • 导入 echarts模块
  • echarts的option存放在methods中(可以将官网案例代码段直接进行复制;粘贴,不需要任何改动)
<template><!--为echarts准备一个具备大小的容器dom--><div id="main" style="width: 600px; height: 400px"></div>
</template>
<script>
import echarts from "echarts";
export default {name: "",data() {return {DAB: {},};},methods: {drawData() {this.$axios.get("/static/json/DAB.json").then((response) => {console.log('000')console.log(response.data);this.DAB = JSON.parse(JSON.stringify(response.data));console.log("111");console.log(this.DAB.data1);this.drawPie("main")},(error) => {console.log(error);});},drawPie(id) {// this.getData();console.log('444')console.log(this.DAB.data1)this.charts = echarts.init(document.getElementById(id));this.charts.setOption({title: {text: "DAB Cover failure SVM Prediction",subtext: "Data from: 2021-04-14",},grid: {left: "3%",right: "7%",bottom: "7%",containLabel: true,},tooltip: {// trigger: 'axis',showDelay: 0,formatter: function (params) {if (params.value.length > 1) {return (params.seriesName +" :<br/>" +params.value[0] +"cm " +params.value[1] +"kg ");} else {return (params.seriesName + " :<br/>" + params.name + " : " + params.value + "kg ");}},axisPointer: {show: true,type: "cross",lineStyle: {type: "dashed",width: 1,},},},toolbox: {feature: {dataZoom: {},brush: {type: ["rect", "polygon", "clear"],},},},brush: {},legend: {data: ["No Failure", "Failure"],left: "center",bottom: 10,},xAxis: [{type: "value",scale: true,axisLabel: {formatter: "{value} cm",},splitLine: {show: false,},},],yAxis: [{type: "value",scale: true,axisLabel: {formatter: "{value} kg",},splitLine: {show: false,},},],series: [{name: "No failure",type: "scatter",emphasis: {focus: "series",},data: this.DAB.data1.nofailure,markArea: {silent: true,itemStyle: {color: 'transparent',borderWidth: 1,borderType: 'dashed'},data: [[{name: 'No failure Data Range',xAxis: 'min',yAxis: 'min'}, {xAxis: 'max',yAxis: 'max'}]]},markPoint: {data: [{type: 'max', name: 'Max'},{type: 'min', name: 'Min'}]},markLine: {lineStyle: {type: 'solid'},data: [{type: 'average', name: '平均值'},{ xAxis: 160 }]}},{name: "Failure",type: "scatter",emphasis: {focus: "series",},data: this.DAB.data1.failure,markArea: {silent: true,itemStyle: {color: 'transparent',borderWidth: 1,borderType: 'dashed'},data: [[{name: 'Failure Data Range',xAxis: 'min',yAxis: 'min'}, {xAxis: 'max',yAxis: 'max'}]]},markPoint: {data: [{type: 'max', name: 'Max'},{type: 'min', name: 'Min'}]},markLine: {lineStyle: {type: 'solid'},data: [{type: 'average', name: 'Average'},{ xAxis: 170 }]}},],});},},//调用mounted() {this.drawData();// console.log("222");// console.log(this.DAB.data1);//   if (Array.isArray(this.classList) && this.classList.length > 0) {//   this.$nextTick(function () {//     this.drawPie("main");//   });// }},
};
</script>
<style scoped>
* {margin: 10;padding: 0;list-style: none;
}
</style>

总结

对比两种方法,直接使用echarts组件是比较方便的,有利于一个页面上同时显示不同类型的图标。
此外,不清楚会不会存在vue-echarts更新过慢或者不兼容的问题。

困难点

  • vue mounted 中向传入data的数据,貌似不行,找了网上解决方法,没有成功,好像只能运行methods中的函数,索性就把axios获取json文件的代码写到了绘图的前面,就解决了。
http://www.lbrq.cn/news/2709613.html

相关文章:

  • 怎样给网站做新闻稿子爱站数据
  • 房地产网站模板库关键词免费下载
  • 网牛网站建设搜狗输入法下载安装
  • 6618自助建站系统源码浏览器看b站
  • 怎样把一个网站建设的更好网络推广公司加盟
  • 一个服务器下怎么做两个网站吗百度相册登录入口
  • 门户类网站建设需要多少钱竞价排名适合百度吗
  • 静态网站跟动态湖南seo推广软件
  • 辽宁做网站服务器域名怎么注册
  • 邯郸企业网站建设正规的关键词优化软件
  • 大同网站建设站建设东莞seo外包公司哪家好
  • 装饰公司做网站怎么收费搜狗识图
  • 百度站长资源管理百度指数官网登录
  • 潍坊专业网站建设最新报价排名
  • 如何网站做百度推广南京seo推广公司
  • 杭州行业网站建设公司长沙网站seo报价
  • 网站建设中 html 下载南京百度快照优化排名
  • 蔬菜基地做网站合适吗seo博客模板
  • 建设局属于什么行业成都市seo网站公司
  • 青海网站 建设网络营销评价的名词解释
  • 景区网站建设教程天桥区seo全网宣传
  • 杭州公司建网站外贸网站平台都有哪些 免费的
  • 没有网站域名是否需要备案百度搜索排名机制
  • 做烘培的网站ebay欧洲站网址
  • 网站开发网站页面网络营销具有什么特点
  • 一个月做网站广告推广有哪些平台
  • 企业网站怎么做连接谷歌seo推广招聘
  • 公司以前做的免费网站太多_新网站搜索不到关键词歌曲歌词
  • 中企动力网站软考培训机构哪家好一点
  • 张家港网站 设计制作seo权重优化软件
  • 【每天一个知识点】生物的数字孪生
  • Python之Django使用技巧(附视频教程)
  • 【深度学习计算性能】04:硬件
  • K8s学习----Namespace:资源隔离与环境管理的核心机制
  • 机器学习-Cluster
  • Flutter网络请求实战:Retrofit+Dio完美解决方案