echarts之折线图配置(附带图例很多做成分页效果)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>ECharts-基本线性图及其配置要求</title>
<!-- ECharts单文件引入 -->
<script src="http://echarts.baidu.com/build/dist/echarts-all.js"></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div id="box" style="height:400px;width: 800px;padding: 20px"></div>
</div>
<script>
// 获取到这个DOM节点,然后初始化 var myChart = echarts.init(document.getElementById("box"));
var option = {
// 标题
title: {
text: '红包活动数据',
subtext: '数据来源:华秉科技-dancer'
},
tooltip: {
trigger: 'axis'
},
//图例名
legend: {
data:['参加活动人数','分享人数','关注人数','注册人数','领取红包人数']
},
grid: {
left: '3%', //图表距边框的距离
right: '4%',
bottom: '3%',
containLabel: true
},
//工具框,可以选择
toolbox: {
feature: {
saveAsImage: {}
}
},
//x轴信息样式
xAxis: {
type: 'category',
boundaryGap: false,
data: ['12-01','12-02','12-03','12-04','12-05','12-05','12-06','12-07','12-08','12-09','12-10','12-11','12-12','12-13'],
//坐标轴颜色
axisLine:{
lineStyle:{
color:'red'
}
},
//x轴文字旋转
axisLabel:{
rotate:30,
interval:0
},
}, yAxis : [
{
type : 'value',
axisLabel : {
formatter: '{value} 人'
}
}
],
series: [
//虚线
{
name:'参加活动人数',
type:'line',
symbolSize:4, //拐点圆的大小
color:['red'], //折线条的颜色
data:[1000, 300, 500, 800, 300, 600,500,800, 300, 500, 800, 300, 600,500],
smooth:false, //关键点,为true是不支持虚线的,实线就用true
itemStyle:{
normal:{
lineStyle:{
width:2,
type:'dotted' //'dotted'虚线 'solid'实线
}
}
}
},
//实线
{
name:'分享人数',
type:'line',
symbol:'circle',
symbolSize:4,
itemStyle:{
normal:{
color:'red',
borderColor:'red' //拐点边框颜色
}
},
data:[220, 182, 191, 234, 290, 330, 310,220, 182, 191, 234, 290, 330, 310]
},
{
name:'关注人数',
type:'line',
// stack: '总量',
symbolSize:4,
color:['orange'],
smooth:false, //关键点,为true是不支持虚线的,实线就用true
itemStyle:{
normal:{
lineStyle:{
width:2,
type:'dotted' //'dotted'虚线 'solid'实线
}
}
},
data:[500, 232, 201, 154, 190, 330, 410,150, 232, 201, 154, 190, 330, 410]
},
{
name:'注册人数',
type:'line',
symbolSize:4,
color:['blue'],
itemStyle:{
normal:{
lineStyle:{
width:2,
type:'dotted' //'dotted'虚线 'solid'实线
}
}
},
data:[300, 232, 201, 154, 190, 330, 410,150, 232, 201, 154, 190, 330, 410]
},
{
name:'领取红包人数',
type:'line',
color:['green'],
symbol:'circle',
symbolSize:4,
data:[310, 352, 280, 334, 373, 310, 340,300, 350, 280, 350, 340, 370, 310],
itemStyle:{
normal:{
color:'green',
borderColor:'green'
}
}
}
]
}; myChart.setOption(option);
</script>
</body>
</html>

附带:
附带1:http://echarts.baidu.com/examples/editor.html?c=pie-legend
附带2:http://echarts.baidu.com/examples/editor.html?c=radar2
echarts之折线图配置(附带图例很多做成分页效果)的更多相关文章
- ECharts使用—折线图动态加载
最近需求中用到折线图,单线条,多线交错,之前是散点图,用的是另一个 amcharts.js,这个文档也能找的到,回归早本次重点:ECharts 一.首先引入echarts.common.min.js文 ...
- echarts折现图配置
js引用和div容器 <div id="container" style="height: 100%"></div> <scrip ...
- Echarts line折线图使用(vue)
实现 首先引入echarts工具 // vue文件中引入echarts工具 let echarts = require('echarts/lib/echarts') require('echarts/ ...
- echarts自定义折线图横坐标时间间隔踩坑总结
折线图需求:横坐标为时间,要求按一定间隔展示,鼠标移至折线上间隔时间内的数据也可展示 其实很简单的一个配置就可搞定,但在不熟悉echarts配置的情况下,就很懵逼 xAxis: { boundaryG ...
- ECharts绘制折线图
首先看实现好的页面 实现 首先引入echarts工具 // vue文件中引入echarts工具 let echarts = require('echarts/lib/echarts') require ...
- echarts版本折线图
1.效果如下: 绘制折线图,应该算是说echarts中使用最简单也算使用频率最高的一种功能了吧.根据官网列子能找出规律,只是有些属性对于初接触者来说,会有点陌生,不过仔细阅读一下还是不 ...
- 移动端引用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 ...
随机推荐
- 自定制property
class Lazyproperty: def __init__(self, func): self.func = func def __get__(self, instance, owner): p ...
- odoo二次开发 tips
1.model属性 每个对象(即class)一般由字段(变量)和函数组成,每个对象对应着数据库中的一张表,驼峰命名方式 models.Model 基础模块,会根据字段和模型名在后台数据库生成对应得表文 ...
- 前端paging分页,前端设置每页多少条和当前页面的索引,传给后端,数据显示出来
1.首先引入jquery 2.在引入paging.css和paging.js 这2个我存在百度云上: 链接:https://pan.baidu.com/s/1SPxlBkkx-pNAtLuRLifE ...
- Vue Watch 的原理 和 $nextTick() 通俗理解
网上watch和$nextTick()解释比较复杂,涉及到promise,h5的dom发生变化的新api等复杂代码,下列就是两个参考. [watch原理] [$nextTick()] 首先,看遇到问题 ...
- 海思编解码芯片添加64M nor flash
uboot和内核都必须修改. struct spi_info hisfc350_spi_info_table[] : 在结构体里面添加自己的flash节点,我这里用的是MX66LS51235E { & ...
- Mac同时安装python2和python3
Mac同时安装python2和python3 Mac自带python2,但因为开发时所用但pythonkennel是3也可能是2,并且就算是python2,版本号也许和内置但python也有所不同.所 ...
- 十一、无事勿扰,有事通知(2)——KVO
概述 Key-Value-Observe,简称KVO,和上节介绍的Notification师出同门,主要目的都是为了实现观察者模式. 虽说是同门师兄弟,但是各自精通的技艺却是各不相同的. 不像Noti ...
- [ Python ] unittest demo
# -*- coding: utf-8 -*- import unittest class MyUT(unittest.TestCase): def test_1(self): print(" ...
- WebForm跨页面传值取值、C#服务端跳转页面、 Button的OnClientClick属性和超链接点击弹出警示框
一.跨页面传值和取值: 1.QueryString - url传值,地址传值 优缺点:不占用服务器内存:保密性差,传递长度有限. 通过跳转页面路径进行传值方式: href="地址?key=v ...
- week_one-python格式化输出
1.多行格式化输出 (1) # Author:larlly name = input("input your name :") age = input("input yo ...