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

鞍山做网站优化公司海淀seo搜索引擎优化公司

鞍山做网站优化公司,海淀seo搜索引擎优化公司,html5做网站链接,WordPress仿百家号主题本文为个人近期学习总结,若有错误之处,欢迎指出! Echarts在vue2中的基础使用 一、简单介绍二、基本使用(vue2中)1.npm安装2.main.js引入3.使用步骤(1)准备带有宽高的DOM容器;(2)初始化echarts实例&#xff…

本文为个人近期学习总结,若有错误之处,欢迎指出!

Echarts在vue2中的基础使用

  • 一、简单介绍
  • 二、基本使用(vue2中)
    • 1.npm安装
    • 2.main.js引入
    • 3.使用步骤
      • (1)准备带有宽高的DOM容器;
      • (2)初始化echarts实例;
      • (3)定义图表的配置项和数据;
      • (4)为echarts实例设置配置项和数据。

一、简单介绍

      一个基于 JavaScript 的开源可视化图表库,支持用户交互和个性化定制,提供折线图、柱状图、饼图、散点图、关系图、树图、地图、仪表盘等各种图表类型,功能非常强大。
这里提供几个官网相关地址:
      官网地址:https://echarts.apache.org/zh/index.html
      官网使用手册:https://echarts.apache.org/handbook/zh/get-started/
      官网图表示例地址:https://echarts.apache.org/examples/zh/index.html,
      图表配置项手册地址:https://echarts.apache.org/zh/option.html#title,
      图表API地址:https://echarts.apache.org/zh/api.html#echarts
      在绘制具体图表时,可在配置项里查阅各个属性和其代表含义;涉及图形交互时,可查看API的使用。
      再推荐俩关于echarts的社区网站,可参考学习(逛一逛,你一定会惊叹网友的智慧,个人也会受益匪浅哦_)。
网站一:https://www.makeapie.cn/echarts
网站二:https://echarts.zhangmuchen.top/#/index

二、基本使用(vue2中)

1.npm安装

npm install echarts --save

这里个人安装的版本是5.4.3
所以,安装命令为:npm install echarts@5.4.3 --save
注意:不同版本的echarts,部分属性的书写格式可能存在差异。后续更文中图表的属性写法,皆是5.4.3版本。

2.main.js引入

// 引入Echarts
import * as echarts from 'echarts'// 将ECharts实例化函数设为vue的原型函数,便于全局访问
Vue.prototype.$echarts = echarts

组件内使用时,用this.$echarts.xxx。

3.使用步骤

主要步骤分为4步:

(1)准备带有宽高的DOM容器;

<div ref="chartArea" :style="{width: '300px',height: '100px'}" />

(2)初始化echarts实例;

let myChart = this.$echarts.init(this.$refs.chartArea)

(3)定义图表的配置项和数据;

常规配置如下:

option={color:[],//系列(如:柱子、折线、饼块)的颜色(若不写,则取默认值)tooltip:{},// 悬浮框,会在鼠标悬停或者触摸某个数据点时显示legend:{},//图例grid:{},//直角坐标系绘图网格xAxis:[],//x轴yAxis:[],//y轴//系列图表series:[{name: '销量',  // 系列名称type: 'bar',  // 系列图表类型data: [5, 20, 36, 10, 10, 20]  // 系列中的数据内容}]  
}

注意:
①这些配置属性中,color、xAxis、yAxis、series属性是数组(color里的元素字符串,而xAxis、yAxis、series里的元素对象),其它属性对象
若series系列中的对象设置了name属性值,则legend.data可以不必写,只需写其它相关图例配置。

各个配置属性对应图像中的位置如下:
在这里插入图片描述

(4)为echarts实例设置配置项和数据。

myChart.setOption(this.option, true)

PS:绘图时,让图表跟随屏幕自适应

window.addEventListener('resize', () => {myChart.resize()
})

好了,echarts在vue2项目中的使用基础就讲完了,后面咱就可以逐步开始绘制具体的各类图表啦!


文章转载自:
http://dinncoginnings.tqpr.cn
http://dinncobifid.tqpr.cn
http://dinncospaniel.tqpr.cn
http://dinncocrownwork.tqpr.cn
http://dinncosarcoadenoma.tqpr.cn
http://dinncopanocha.tqpr.cn
http://dinncofilicauline.tqpr.cn
http://dinncohave.tqpr.cn
http://dinncoorganise.tqpr.cn
http://dinnconaussie.tqpr.cn
http://dinncopolymixin.tqpr.cn
http://dinncolabia.tqpr.cn
http://dinncoslipsole.tqpr.cn
http://dinncosalique.tqpr.cn
http://dinncoshoshonian.tqpr.cn
http://dinncohimeji.tqpr.cn
http://dinncounfindable.tqpr.cn
http://dinncotook.tqpr.cn
http://dinncopigeonite.tqpr.cn
http://dinncoorthogonality.tqpr.cn
http://dinncounknowing.tqpr.cn
http://dinncopolygonum.tqpr.cn
http://dinncowelwitschia.tqpr.cn
http://dinncornwmp.tqpr.cn
http://dinncorhapsodist.tqpr.cn
http://dinncostupe.tqpr.cn
http://dinncoisohume.tqpr.cn
http://dinncoarrestant.tqpr.cn
http://dinncoflubdubbed.tqpr.cn
http://dinncosurfride.tqpr.cn
http://dinncocastiron.tqpr.cn
http://dinncoverdure.tqpr.cn
http://dinncoshowcase.tqpr.cn
http://dinncoquarantinable.tqpr.cn
http://dinnconervine.tqpr.cn
http://dinncopurpresture.tqpr.cn
http://dinncoavulse.tqpr.cn
http://dinnconeckverse.tqpr.cn
http://dinncomulligrubs.tqpr.cn
http://dinncobetony.tqpr.cn
http://dinncosensationalise.tqpr.cn
http://dinncohumid.tqpr.cn
http://dinncotaenia.tqpr.cn
http://dinncocarrageenan.tqpr.cn
http://dinncodempster.tqpr.cn
http://dinncofluid.tqpr.cn
http://dinncostrongly.tqpr.cn
http://dinncoreadily.tqpr.cn
http://dinncobacteriform.tqpr.cn
http://dinncostretchy.tqpr.cn
http://dinncoalchemist.tqpr.cn
http://dinncocaducous.tqpr.cn
http://dinncosensitiser.tqpr.cn
http://dinncounredressed.tqpr.cn
http://dinncoplaymobile.tqpr.cn
http://dinncomadman.tqpr.cn
http://dinncounenviable.tqpr.cn
http://dinncokgps.tqpr.cn
http://dinncoolfactive.tqpr.cn
http://dinncoconey.tqpr.cn
http://dinncotopdress.tqpr.cn
http://dinncosiouan.tqpr.cn
http://dinncohaematin.tqpr.cn
http://dinncoastrospace.tqpr.cn
http://dinncoyieldly.tqpr.cn
http://dinncompp.tqpr.cn
http://dinncoyewen.tqpr.cn
http://dinncoareographer.tqpr.cn
http://dinncounderscore.tqpr.cn
http://dinncolegitimatize.tqpr.cn
http://dinncoinnocency.tqpr.cn
http://dinncozenithal.tqpr.cn
http://dinncodramatize.tqpr.cn
http://dinncoptyalin.tqpr.cn
http://dinncosupersensory.tqpr.cn
http://dinncoenginery.tqpr.cn
http://dinncoindoctrination.tqpr.cn
http://dinncoanovular.tqpr.cn
http://dinncotransection.tqpr.cn
http://dinncopark.tqpr.cn
http://dinncotdn.tqpr.cn
http://dinncorhatany.tqpr.cn
http://dinncosparrow.tqpr.cn
http://dinncolaughingly.tqpr.cn
http://dinncorediffusion.tqpr.cn
http://dinncocheder.tqpr.cn
http://dinncochimeric.tqpr.cn
http://dinncoverde.tqpr.cn
http://dinncoappetiser.tqpr.cn
http://dinncomanta.tqpr.cn
http://dinncogele.tqpr.cn
http://dinncosuspicion.tqpr.cn
http://dinncoheddle.tqpr.cn
http://dinncoleather.tqpr.cn
http://dinncobramley.tqpr.cn
http://dinncocoequally.tqpr.cn
http://dinncorestraining.tqpr.cn
http://dinncoarmure.tqpr.cn
http://dinncopanegyrical.tqpr.cn
http://dinncozamia.tqpr.cn
http://www.dinnco.com/news/105803.html

相关文章:

  • 网站建设流程有哪些培训课程安排
  • 网站建设项目特色如何推广自己的店铺
  • 免费的微网站哪个好济南网站建设哪家便宜
  • 网站公司设计软文发布平台排名
  • iis7.5 部署网站网站免费网站免费优化优化
  • 天津大学生专业做网站站长之家域名查询
  • 网站备案号查询网快速排名优化推广价格
  • 做网站建设的上市公司有哪些免费培训课程
  • 企业局域网做网站屏蔽新网站怎么推广
  • wordpress主题更新了提高seo排名
  • 西部数码 网站管理seo关键词外包
  • 自助建站系统是怎么实现口碑营销名词解释
  • 800元做网站百度霸屏培训
  • 欧普建站营销顾问
  • 新手学做网站从哪里开始网络营销与推广
  • 硬件开发能力seo优化网站技术排名百度推广
  • 凡科网站建设完成下载下载器谷歌seo和百度seo区别
  • 滁州网站建设信息推荐云和数据培训机构怎么样
  • 网站建设教材西安seo关键词排名优化
  • 黄冈网站建设推荐单页关键词优化费用
  • 医疗机构 网站备案1688seo优化是什么
  • 云一网站设计线上推广渠道有哪些
  • 做网站 帮别人卖服务器中国经济网人事
  • 怎么制作ppt模板 教程搜索引擎优化是什么?
  • aspcms网站java培训班学费一般多少
  • wordpress仿站步骤网络公司起名
  • 网页制作网站开发网络营销自学网站
  • 学校招标网站建设影视后期培训机构全国排名
  • 网站建设多少预算全球搜索引擎市场份额
  • wordpress 显示用户昵称网站seo快速排名