# 綜合應用
******
* 實現靈活應用
* [在線演示](http://demo.sgfoot.com/ECharts/mix.html)
>[info] 完整代碼
~~~
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>綜合</title>
<script type="text/javascript" src="../asset/js/echarts.common.min.js"></script>
<style>
div{
display: inline-block;
}
</style>
</head>
<body>
<div id="bar" style="width: 2000px;height:400px;"></div>
<script>
bar();
function bar() {
var myChart = echarts.init(document.getElementById("bar"));
// 指定圖表的配置項和數據
var data = new Array();
var data1 = new Array();
var data2 = new Array();
var num = new Array();
for(var i = 1;i < 1000; i++) {
data.push(Math.ceil(Math.random()*100));
data1.push(Math.ceil(Math.random()*90));
data2.push(Math.ceil(Math.random()*80));
num.push(i);
}
var option = {
title: {
text: 'ECharts 矩形圖',
subtext: '來自時光演示網',
sublink: 'http://demo.sgfoot.com',
left: 'center',
textStyle: {
color: '#2E3299'
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
dataZoom: [
{
type: 'slider',
show: true,
start: 94,
end: 100,
handleSize: 40
},
{
type: 'inside',
start: 94,
end: 100
},
{
type: 'slider',
show: true,
yAxisIndex: 0,
filterMode: 'empty',
width: 12,
height: '70%',
handleSize: 8,
showDataShadow: false,
left: '93%'
}
],
legend: {
orient: 'vertical',
left:'right',
data:['瀏覽量', '銷量', 'view'],
textStyle: {
color: '#000'
}
},
xAxis: {
data: num
},
yAxis: {},
series: [{
name: '瀏覽量',
type: 'line',
data: data,
label: {
normal: {
show: true,
position: 'top'
}
}
},{
name: '銷量',
type: 'bar',
data: data1,
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
}
},{
name: 'view',
type: 'bar',
data: data2,
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
}
}]
};
// 使用剛指定的配置項和數據顯示圖表。
myChart.setOption(option);
}
</script>
</body>
</html>
~~~

- 總導航
- 第一章 前端
- 1.0 js自定義模板
- 第二章 PHP
- 1.0 推薦博客
- 2.0 基礎理論
- 0.1 require和include區別
- 0.2 php運行機制
- 0.3 Http請求與響應
- 0.4 http響應狀態
- 3.0 Laravel框架
- 0.1 Eloquent ORM
- 0.2 時間處理
- 0.3 數據遷移
- 0.4 填充數據
- 4.0 composer安裝
- 5.0 緩存
- 0.1 Opcache
- 0.2 Memcache
- 0.3 Redis
- 0.4 Output buffer
- 第三章 MYSQL
- 1.0 新增和重置密碼
- 第四章 前端插件集
- 1.0 PreloadJS
- 0.1 LoadQueue
- 0.2 加載單個文件
- 0.3 加載進度顯示
- 0.4 加載指定目錄圖片
- 0.5 加載json圖片
- 2.0 Swiper
- 3.0 ECharts
- 0.1 簡單實例
- 0.2 title操作
- 0.3 tooltip操作
- 0.4 top顯示數字
- 0.5 雙數據顯示
- 0.6 大數據縮放顯示
- 0.7 綜合
- 4.0 Vue
- 0.1 模板語法
- 0.2 條件與循環
- 0.3 處理用戶輸入
- 0.4 計算屬性
- 0.5 事件綁定
- 0.6 動態渲染列表
- 5.0 layui
- 0.1 動態渲染nav
- 0.2 layer使用
- 6.0 IScroll
- 7.0 AlloyTouch
- 8.0 jquery.tagsinput
- 9.0 Editormd
- 第五章 應用軟件
- 1.0 Xshell
- 一螺集
- PHP
- 打印一天的區間時間
- 友好時間輸出
- 導出Excel
- JAVASCRIPT
- js回車事件