使用Echarts实现折线图的一点总结
使用Echarts的一点总结
1.安装,我使用得vue
cnpm install echarts --save
2.在入口文件main.js中注册,并使用
// 引入折线图 echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
3.在需要使用折线图的模块使用
3.1 html部分,给定一个div
<div id="sleep" class="zonghe"></div>
3.2 js部分
// 睡眠
sleep() {
// 基于准备好的dom,初始化echarts实例
let sleep = this.$echarts.init(document.getElementById("sleep"));
// 绘制图表
sleep.setOption({
tooltip: {},
xAxis: {
name: "日期",
nameLocation: "end",
nameTextStyle: {
padding: -12
},
data: ["1", "2", "3", "4", "5"],
type: "category",
boundaryGap: false
},
color: ["#dcb7fe"],
yAxis: {
type: "value",
name: "分数",
nameLocation: "end",
nameTextStyle: {
padding: -8
}
},
series: [
{
data: [54, 86, 36, 45, 75],
type: "line"
}
]
});
},
3.3 css部分
.zonghe {
width: 6rem;
height: 6rem;
font-size: 0.15rem;
color: rgb(179, 179, 179);
margin-left: 0.46rem;
margin-right: 0.46rem;
margin-top: -0.6rem;
}
4.最后实现效果
已经没有了哦!thank you!
使用Echarts实现折线图的一点总结的更多相关文章
- echarts版本折线图
1.效果如下: 绘制折线图,应该算是说echarts中使用最简单也算使用频率最高的一种功能了吧.根据官网列子能找出规律,只是有些属性对于初接触者来说,会有点陌生,不过仔细阅读一下还是不 ...
- Echarts line折线图使用(vue)
实现 首先引入echarts工具 // vue文件中引入echarts工具 let echarts = require('echarts/lib/echarts') require('echarts/ ...
- ECharts使用—折线图动态加载
最近需求中用到折线图,单线条,多线交错,之前是散点图,用的是另一个 amcharts.js,这个文档也能找的到,回归早本次重点:ECharts 一.首先引入echarts.common.min.js文 ...
- 移动端引用echarts的折线图
移动端写一个图表引用echarts,highcharts插件,本次要找一个能够显示最新数据的折线图,最后只找到显示最大值: 找到echarts的实例:记一下个各功能. <!DOC ...
- echarts实现折线图
前端框架使用的angular,折线图使用echarts实现. 这里实现的折线图只是简单是折线图,折线图显示在table中,不需要xy轴的数据说明. 1. item.component.html < ...
- Echarts案例-折线图
一:先在官网下载 https://www.echartsjs.com/zh/download.html 然后再建立工程,导入这两个包: 写代码: <!DOCTYPE html> <h ...
- echarts自定义折线图横坐标时间间隔踩坑总结
折线图需求:横坐标为时间,要求按一定间隔展示,鼠标移至折线上间隔时间内的数据也可展示 其实很简单的一个配置就可搞定,但在不熟悉echarts配置的情况下,就很懵逼 xAxis: { boundaryG ...
- echarts之折线图介绍及使用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- ECharts绘制折线图
首先看实现好的页面 实现 首先引入echarts工具 // vue文件中引入echarts工具 let echarts = require('echarts/lib/echarts') require ...
随机推荐
- Phpstorm 2020-01-04试了可用的激活码【亲测可用】WebStrom
[直接点击试用30天] http://myphp.vip/ 测试时间:2018-10-12可用(v2019.2) 测试时间:2019-12-24可用(v2019.2) 测试时间:2020-01-04可 ...
- JS中0.1+0.2!=0.3
在控制台输入0.1+0.2,会得出以下结果 即不等于0.3.下面我们说一下原因. 一.存储原理 1.在计算机中数字无论是定点数还是浮点数都是以多位二进制的方式进行存储的.2.在JS中数字采用的IEEE ...
- idea git pull fatal: bad config line 1 in file /.gitconfig 问题处理
在网上搜好多都是直接改username和useremail的,但是没有说明原理. 因为我的电脑是新入职接手上一家的电脑 后来在git bash 里面用$ git config user.name 原来 ...
- day9 修改文件
# 修改文件 # 文件是不能修改 with open('小护士班主任', mode='r', encoding='utf-') as f, open('小护士班主任.bak', 'w', encodi ...
- 【python基础语法】第4天作业练习题
""" 有6道题(通过字典来操作): 1. 某比赛需要获取你的个人信息,设计一个程序, 运行时分别提醒输入 姓名.性别.年龄 ,输入完了,请将数据存储为一个字典, 2.数 ...
- 初识Mybatis和一些配置和练习
什么是Mybatis: MyBatis 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及高级映射. MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集. MyBat ...
- JavaSE学习笔记(6)---异常
JavaSE学习笔记(6)---异常 软件程序在运行过程中,非常可能遇到问题,我们称之为异常,英文是:Exception,意思是例外.遇到这些例外情况,或者叫异常,我们怎么让写的程序做出合理的处理 ...
- 【database】oracle集合 - Associative Arrays、Varrays、Nested Tables
前言 参考oracle官方文档:PL/SQL Language Reference 11g Release 2 - 5 PL/SQL Collections and Records 可以去看下文档 ...
- PAT (Advanced Level) Practice 1036 Boys vs Girls (25 分)
This time you are asked to tell the difference between the lowest grade of all the male students and ...
- 【算法】用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。
public class Solution { Stack<Integer> stack1 = new Stack<Integer>(); Stack<Integer&g ...