<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="echarts.js"></script>
<script src="jquery-1.10.2.js"></script>
</head>
<body>
<div id="box" style="width:960px;height:500px;margin:0 auto;"></div>
<script>
var myChart = echarts.init(document.getElementById('box'));
$.get('aqi-beijing.json', function (data) {
myChart.setOption(option = {
title: {
text: 'Beijing AQI'
},
tooltip: {
trigger: 'axis'
},
xAxis: {
data: data.map(function (item) {
return item[];
})
},
yAxis: {
splitLine: {
show: false
}
},
toolbox: {
left: 'center',
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
dataZoom: [{
startValue: '2014-06-01'
}, {
type: 'inside'
}],
visualMap: {
top: ,
right: ,
pieces: [{
gt: ,
lte: ,
color: '#096'
}, {
gt: ,
lte: ,
color: '#ffde33'
}, {
gt: ,
lte: ,
color: '#ff9933'
}, {
gt: ,
lte: ,
color: '#cc0033'
}, {
gt: ,
lte: ,
color: '#660099'
}, {
gt: ,
color: '#7e0023'
}],
outOfRange: {
color: '#999'
}
},
series: {
name: 'Beijing AQI',
type: 'line',
data: data.map(function (item) {
return item[];
}),
markLine: {
silent: true,
data: [{
yAxis:
}, {
yAxis:
}, {
yAxis:
}, {
yAxis:
}, {
yAxis:
}]
}
}
});
});
</script>
</body>
</html>

demo链接:http://echarts.baidu.com/demo.html#line-aqi

api:http://echarts.baidu.com/option.html#visualMap-piecewise.pieces

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="echarts.js"></script>
</head>
<body>
<div id="box" style="width:960px;height:500px;margin:0 auto;"></div>
<script>
var weiChart = echarts.init(document.getElementById('box'));
var data1=[, , , "-", "-", "-", "-"];
var data2=["-", "-", , , , "-", "-"];
var data3=["-", "-", "-", "-", , , ];
option = {
title: {
text: '折线图堆叠'
},
tooltip: {
trigger: 'axis'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一','周二','周三','周四','周五','周六','周日']
},
yAxis: {
type: 'value'
},
series: [
{
name:'',
type:'line',
data:data1
},
{
name:'',
type:'line',
data:data2
},
{
name:'',
type:'line',
data:data3
}, ]
};
weiChart.setOption(option);
</script>
</body>
</html>

echarts分段(一段一种颜色)显示的更多相关文章

  1. 【编程题目】一串首尾相连的珠子(m 个),有 N 种颜色(N<=10),取出其中一段,要求包含所有 N 中颜色,并使长度最短。

    40.百度研发笔试题 2)一串首尾相连的珠子(m 个),有 N 种颜色(N<=10),设计一个算法,取出其中一段,要求包含所有 N 中颜色,并使长度最短.并分析时间复杂度与空间复杂度. 思路: ...

  2. Html+Css+Js_之table每隔3行显示不同的两种颜色

    <html> <head> <script type="text/javascript"> /** 最近因项目的需求,有这样的一个问题: 一个t ...

  3. Android代码中设置字体大小,字体颜色,显示两种颜色.倒计时效果

    Android代码中设置字体大小,字体颜色,显示两种颜色 在xml文件中字体大小用的像素 <TextView android:id="@+id/uppaid_time" an ...

  4. Android TextView里显示两种颜色

    今天介绍一个小技巧,在Android的TextView里设置两种颜色,直接上代码: TextView TV = (TextView)findViewById(R.id.mytextview01); S ...

  5. 魅蓝Note有几种颜色 魅蓝Note哪个颜色好看

    http://www.pc841.com/shoujizhishi/39882.html http://news.mydrivers.com/1/359/359443.htm 魅族发布首款千元高性价比 ...

  6. echarts x轴标签文字过多导致显示不全

    原文电梯:https://blog.csdn.net/kebi007/article/details/68488694 echarts x轴标签文字过多导致显示不全 如图: 解决办法1:xAxis.a ...

  7. 一个label两种颜色,一个label两种字体

    -(void)addLabel{ UILabel *label = [[UILabel alloc]init]; label.backgroundColor = [UIColor grayColor] ...

  8. APP界面常用的五种颜色搭配

    众所周知,每一种颜色带给用户的视觉感受也是不同的.现在人们对手机的依赖程度,就能看到手机中APP的发展前景,那今天就跟大家聊聊如何通过颜色搭配的不同来进行移动端APP界面的布局和排版设计.移动端UI界 ...

  9. YTU 2629: E1 一种颜色,三个分量

    2629: E1 一种颜色,三个分量 时间限制: 1 Sec  内存限制: 128 MB 提交: 300  解决: 226 题目描述 在计算机中,常用三种基色红(R).绿(G).蓝(B)的混合来表示颜 ...

随机推荐

  1. fluent仿真数值错误

  2. HDU 4879 ZCC loves march (并查集,set,map)

    题面以及思路:https://blog.csdn.net/glqac/article/details/38402101 代码: #include <bits/stdc++.h> #defi ...

  3. Boost 线程学习笔记

    Bolg转载自:http://www.cnblogs.com/lvdongjie/p/4447193.html 一: 创建线程 #include <iostream> #include & ...

  4. 前端学习笔记2017.6.21-html和浏览器的关系以及开发工具

    html文档是一种文件格式, 浏览器可以识别这种文件格式,并能把html文档里面的内容解析出来. 用更贴近程序员的话说就是:html相当于c语言,浏览器相当于c编译器. 开发工具用sublime te ...

  5. Luogu 3233 [HNOI2014]世界树

    BZOJ 3572 首先看出虚树,然后考虑如何$dp$. 我们先在处理出的虚树上$dp$一遍,处理出虚树上所有点距离最近的关键点(关键点一定在虚树上嘛). 具体来说,先搜一遍处理出每一个点的父亲到它的 ...

  6. Luogu 4867 Gty的二逼妹子序列

    BZOJ3809,是权限题. 我永远喜欢莫队. 先莫队一下移下左右指针,然后用一个数据结构维护一下区间$[a, b]$中的颜色的值,跟着指针移动一起修改修改,每一次$query$的时候就相当于查询一下 ...

  7. Entity Framework Code-First(18):Turn off DB Initializer

    Turn off DB Initializer in Code-First: You can also turn off the DB initializer of your application. ...

  8. [学习笔记]fork写实复制

    #include<stdio.h> #include<stdlib.h> #include<string.h> #include <unistd.h> ...

  9. 前端文件加载 net::ERR_CONTENT_LENGTH_MISMATCH

    前端文章加载的时候有的时候图片不显示,有的时候文件加载不了,检查nginx设置都没有问题,最近才不显示,经检查是nginx服务器磁盘空间已满,将.log文件移动到其他位置 cp  /dev/null ...

  10. [转]Marshaling a SAFEARRAY of Managed Structures by P/Invoke Part 3.

    1. Introduction. 1.1 In part 1 of this series of articles, I demonstrated how to transfer managed ar ...