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的更多相关文章

  1. d3.js 教程 模仿echarts折线图

    今天我们来仿echarts折线图,这个图在echarts是折线图堆叠,但是我用d3改造成了普通的折线图,只为了大家学习(其实在简单的写一个布局就可以).废话不多说商行代码. 1 制作 Line 类 c ...

  2. 实现Echarts折线图的虚实转换

    需求:医院的体温单,在统计体温时,对于正常情况下统计的体温数据,需要显示实线:对于进行物理降温后统计的体温数据,需要显示虚线. 现有的体温单是运用 Echarts 折线图,统一用实线显示.因此在这基础 ...

  3. echarts折线图动态改变数据时的一个bug

    echarts折线图中当增加dataZoom,修改start大于0的时候,会出现折线混乱,变成竖直的线,绘制有问题. 解决方法,在dataZoom中增加filterMode: 'empty' http ...

  4. ECharts折线图堆叠设置为不堆叠的方法

    下图是ECharts折线图堆叠的官方源码,设置折线图不堆叠只需要将每一个stack的值设置为不一样的名称或者将stack属性删除即可. option = { title: { text: '折线图堆叠 ...

  5. echarts折线图,数据切换时(最近七天)绘图不合理现象

    echarts折线图,当进行数据切换时存在绘制不合理的问题,数据没错,但绘制不对. 两个0之间的连线应该是平滑直线,如图: 正确的显示: 解决: 在myCharts.setOption(option) ...

  6. vue使用axios读取本地json文件来显示echarts折线图

    编辑器:HBuilderx axios文档:http://www.axios-js.com/zh-cn/docs/ echarts实例:https://echarts.apache.org/examp ...

  7. echarts折线图--数据交互

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  8. Echarts 折线图y轴标签值太长时显示不全的解决办法

    问题 分析 解决办法 问题 先看一下正常的情况 再看一下显示不全的情况 所有的数据都是从后台取的,也就是说动态变化的,一开始的时候数据量不大不会出现问题,后面y轴的值越来越大的时候就出现了这个显示不全 ...

  9. echarts 折线图点击高亮

    echarts中注册事件很多 ,记录下今天做的折线图点击高亮: 查了api,看了半天,发现折线图点击时只能做到圆点变大,并不能实现点击线条,整条线条高亮,也真是醉了. 上图: 如图所示,只能圆点变大. ...

随机推荐

  1. Java中,&&与&,||与|的区别

    在java的逻辑运算符中,有这么四类:&&(短路与),&,|,||(短路或). &&和&都是表示与,区别是&&只要第一个条件不满足,后面 ...

  2. 【360】pandas.DataFrame、array、list 之间转换

    pandas.DataFrame → array → list values 可以转成 array array.tolist() 可以转成 list >>> c 0 1 2 0 0 ...

  3. hibernate criteria Restrictions工具类用法

    CriteriaQuery cq = new CriteriaQuery(TSUser.class, dataGrid); // 查询条件组装器 org.jeecgframework.core.ext ...

  4. Android Studio 版本间区别

    2.3.2 ->3.0.1  Gradle版本为4.1   com.android.tools.build:gradle:3.0.x Android Monitor 被换成了 Android P ...

  5. Spring格式化注解

    Spring Framework 3.0发布了.这里我们介绍其中的一个:用于格式化的注解.简介 Spring 3 提供了两个可以用于格式化数字.日期和时间的注解@NumberFormat和@DateT ...

  6. ubuntu上安装mysql的正确步骤

    1.在Ubuntu software Center中下载mysql:[注:mysql下载下来后好像就安装上了] 2.使用命令检查mysql是否已安装上: 2.1 运行sudo netstat -tap ...

  7. HTTP状态码汇总

  8. c#中连接数据库

    配置文件web.config: <connectionStrings> <add name="eport" connectionString="Data ...

  9. Python基础之-----------函数

    ---恢复内容开始--- 函数:在其他的语言中,我们也经常听到函数的概念,那么什么是函数呢?在Java中叫做method: 定义:函数是指将一组语句的集合通过一个名字(函数名)封装起来,要想执行这个函 ...

  10. python3替换文件的内容

    目标:替换文件中的字符串内容   方法1:使用fileinput包   import fileinput for line in fileinput.input(“要修改的文件名", inp ...