echarts折线图Demo
echarts链接:http://echarts.baidu.com/examples/editor.html?c=line-stack
黑底代码:http://gallery.echartsjs.com/editor.html?c=xr0vvAzzNq&v=1
option = {
backgroundColor: 'black',
tooltip: {
trigger: 'axis'
},
color: ['#f69846', '#00ffb4', '#44aff0', '#f6d54a', '#45dbf7',
'#ad46f3', '#f845f1', '#ff4343', '#ffa800', '#39E7FB', '#FAC901',
],
legend: {
icon: "circle", // 这个字段控制形状 类型包括 circle,rect ,roundRect,triangle,diamond,pin,arrow,none
textStyle: {
color: 'white',
fontSize: 18
},
data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: { //可视化工具箱
x: 'center',
y: '25',
feature: {
dataView: { //数据视图
show: true
},
dataZoom: { //数据缩放视图
show: true
},
magicType: { //动态类型切换
type: ['bar', 'line']
},
restore: { //重置
show: true
},
saveAsImage: { //保存图片
show: true
}
},
iconStyle: {
normal: {
color: 'white', //设置图标颜色
textStyle: {
color: 'white',
fontSize: 1000
},
},
emphasis: { //字体颜色及位置
color: 'white',
textPosition: 'bottom'
}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
axisTick: {
show: false//删除超出正坐标线段
},
axisLine: {
lineStyle: {
color: 'white',
}
},
axisLabel: {
show: true,
textStyle: {
color: 'white',
fontSize: 18
}
},
},
yAxis: {
type: 'value',
axisTick: {
show: false//删除超出正坐标线段
},
axisLine: {
lineStyle: {
color: 'white',
}
},
axisLabel: {
textStyle: {
color: 'white',
fontSize: 18
}
},
splitLine: { //坐标轴以外的横线颜色
lineStyle: {
type:'dashed',//虚线
color: 'white'
}
}
},
series: [{
name: '邮件营销',
type: 'line',
stack: '总量',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '联盟广告',
type: 'line',
stack: '总量',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '视频广告',
type: 'line',
stack: '总量',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: '直接访问',
type: 'line',
stack: '总量',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '搜索引擎',
type: 'line',
stack: '总量',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
白底代码:http://gallery.echartsjs.com/editor.html?c=xmvygFYCqY
option = {
backgroundColor: 'white',
tooltip: {
trigger: 'axis'
},
color: ['#f69846', '#00ffb4', '#44aff0', '#f6d54a', '#45dbf7',
'#ad46f3', '#f845f1', '#ff4343', '#ffa800', '#39E7FB', '#FAC901',
],
legend: {
icon: "circle", // 这个字段控制形状 类型包括 circle,rect ,roundRect,triangle,diamond,pin,arrow,none
textStyle: {
color: 'black',
fontSize: 18
},
data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: { //可视化工具箱
color: 'white',
x: 'center',
y: '25',
feature: {
dataView: { //数据视图
show: true
},
dataZoom: { //数据缩放视图
show: true
},
magicType: { //动态类型切换
type: ['bar', 'line']
},
restore: { //重置
show: true
},
saveAsImage: { //保存图片
show: true
}
},
iconStyle: {
normal: {
color: 'white', //设置图标颜色
},
emphasis: { //字体颜色及位置
color: 'black',
textPosition: 'bottom'
}
}
},
xAxis: {
type: 'category',
axisTick: {
show: false //删除超出正坐标线段
},
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
axisLine: {
lineStyle: {
color: 'black',
}
},
axisLabel: {
show: true,
textStyle: {
color: 'black',
fontSize: 18
}
},
},
yAxis: {
type: 'value',
axisTick: {
show: false //删除超出正坐标线段
},
axisLine: {
lineStyle: {
color: 'black',
}
},
axisLabel: {
textStyle: {
color: 'black',
fontSize: 18
}
},
splitLine: { //坐标轴以外的横线颜色
lineStyle: {
type: 'dashed', //虚线
color: 'black'
}
}
},
series: [{
name: '邮件营销',
type: 'line',
stack: '总量',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '联盟广告',
type: 'line',
stack: '总量',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '视频广告',
type: 'line',
stack: '总量',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: '直接访问',
type: 'line',
stack: '总量',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '搜索引擎',
type: 'line',
stack: '总量',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
echarts折线图Demo的更多相关文章
- d3.js 教程 模仿echarts折线图
今天我们来仿echarts折线图,这个图在echarts是折线图堆叠,但是我用d3改造成了普通的折线图,只为了大家学习(其实在简单的写一个布局就可以).废话不多说商行代码. 1 制作 Line 类 c ...
- 实现Echarts折线图的虚实转换
需求:医院的体温单,在统计体温时,对于正常情况下统计的体温数据,需要显示实线:对于进行物理降温后统计的体温数据,需要显示虚线. 现有的体温单是运用 Echarts 折线图,统一用实线显示.因此在这基础 ...
- echarts折线图动态改变数据时的一个bug
echarts折线图中当增加dataZoom,修改start大于0的时候,会出现折线混乱,变成竖直的线,绘制有问题. 解决方法,在dataZoom中增加filterMode: 'empty' http ...
- ECharts折线图堆叠设置为不堆叠的方法
下图是ECharts折线图堆叠的官方源码,设置折线图不堆叠只需要将每一个stack的值设置为不一样的名称或者将stack属性删除即可. option = { title: { text: '折线图堆叠 ...
- echarts折线图,数据切换时(最近七天)绘图不合理现象
echarts折线图,当进行数据切换时存在绘制不合理的问题,数据没错,但绘制不对. 两个0之间的连线应该是平滑直线,如图: 正确的显示: 解决: 在myCharts.setOption(option) ...
- vue使用axios读取本地json文件来显示echarts折线图
编辑器:HBuilderx axios文档:http://www.axios-js.com/zh-cn/docs/ echarts实例:https://echarts.apache.org/examp ...
- echarts折线图--数据交互
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- Echarts 折线图y轴标签值太长时显示不全的解决办法
问题 分析 解决办法 问题 先看一下正常的情况 再看一下显示不全的情况 所有的数据都是从后台取的,也就是说动态变化的,一开始的时候数据量不大不会出现问题,后面y轴的值越来越大的时候就出现了这个显示不全 ...
- echarts 折线图点击高亮
echarts中注册事件很多 ,记录下今天做的折线图点击高亮: 查了api,看了半天,发现折线图点击时只能做到圆点变大,并不能实现点击线条,整条线条高亮,也真是醉了. 上图: 如图所示,只能圆点变大. ...
随机推荐
- js求时间差,两个日期月份差
var date1=new Date(); //开始时间 alert("aa"); var date2=new Date(); //结束时间 var date3=date2 ...
- SpringBoot读取application.properties文件内容
application.properties存储数据的方式是key-value. application.properties内容 userManager.userFile=data/user.pro ...
- Java中Asm包有什么用?
ASM能做什么 我们都知道,一般情况下,Class文件是通过javac编译器产生的,然后通过类加载器加载到虚拟机内,再通过执行引擎去执行. 现在我们可以通过ASM的API直接生成符合Java虚拟机规范 ...
- Examples: How to Pronounce T
Examples: How to Pronounce T Share Tweet Share Tagged With: Flap T, Stop T The [t] sound is not alwa ...
- debian下redis2.8.17安装过程
下载redis源码包,我下载的是redis2.8.17 解压缩该源码包 tar zxf redis-2.8.17.tar.gz 进入解压缩后的目录 cd redis-2.8.17/ 添加redis用户 ...
- Shell编程常用函数
1.打印提示消息函数,不同级别消息使用不同的颜色显示.其中错误信息提示为红色字体. # -------------------------------------------------------- ...
- monkey压力测试
压力测试: monkey -p com.qihu360.mobilesafe -v -p 后面跟包名 : -v 后面跟次数: 通过观察log日志,查看应用中出现的问题. =============== ...
- deb 和 rpm 后缀文件 区别和安装
https://blog.csdn.net/u010977122/article/details/52986217 下载一个ATOM 的deb的安装包
- git 恢复到旧版本命令
1.第一步:找到你想恢复到的版本号:可以在git提交日志中查看-> 找到版本号,复制下来,在git项目根目录下打开git命令窗口: 输入:git reset --hard xxxxxxxxxxx ...
- Hibernate 再接触 继承映射
用一张 每一个类一张表 建立外键 第一种 一张总表 Person package com.bjsxt.hibernate; import javax.persistence.Discriminator ...