<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
app.title = '世界人口总量 - 条形图';
option = {
// title : {
// text: '世界人口总量',
// subtext: '数据来自网络'
// },
// tooltip: {
// trigger: 'axis',
// // axisPointer: {
// // type: 'shadow'
// // }
// },
// legend: {
// data: ['2011年']
// },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value',
show: false,
boundaryGap: [0, 0.01],
},
yAxis: {
type: 'category',
data: ['6 招商银行','5 广发银行','4 工商银行','3 农业银行','2 中国银行','1 交通银行'],
axisLine: { show: false},
axisTick: {show: false},
},
color:['#2c3f6a','#21927e'],
series: [
{
name: '2011年',
type: 'bar',
barWidth: 15,
itemStyle: {
normal: {
barBorderRadius: 40,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: '#2d3d69'
}, {
offset: 1,
color: '#2b3c67'
}]),
// shadowColor: 'rgba(35,149,229,0.8)',
// shadowBlur: 20,
areaStyle: {type: 'default'},
label : {
show: true,
position: 'right',
formatter: function (params) {
// console.log(params)//这里输出params所有参数 需要什么下面自己拼
// return params.name + params.data;
return "¥" + params.data;
},
textStyle: {
color: '#000000'
}
},
},
},
// itemStyle: {
// // emphasis: {
// // barBorderRadius: 10
// // },
// normal: {
// label : {
// show: true,
// position: 'right',
// formatter: function (params) {
// // console.log(params)//这里输出params所有参数 需要什么下面自己拼
// // return params.name + params.data;
// return "¥" + params.data;
// },
// textStyle: {
// color: '#000000'
// }
// },
// barBorderRadius: 10,
// }
// },
data: [63023, 63023, 63023, 63023, 63023, 63023],
},
{
name: '2012年',
type: 'bar',
barWidth: 15,
itemStyle: {
normal: {
barBorderRadius: 40,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: '#0a6253'
}, {
offset: 1,
color: '#34b9a4'
}]),
// shadowColor: 'rgba(35,149,229,0.8)',
// shadowBlur: 20,
areaStyle: {type: 'default'},
label : {
show: true,
position: 'right',
formatter: function (params) {
// console.log(params)//这里输出params所有参数 需要什么下面自己拼
// return params.name + params.data;
return "¥" + params.data;
},
textStyle: {
color: '#000000'
}
},
},
},
// itemStyle: {
// normal: {
// label : {
// show: true,
// position: 'right',
// formatter: function (params) {
// // console.log(params)//这里输出params所有参数 需要什么下面自己拼
// // return params.name + params.data;
// return "¥" + params.data;
// },
// textStyle: {
// color: 'tomato'
// }
// }
// }
// },
data: [19325, 33438, 3100, 12159, 13414, 33438],
// itemStyle : { normal: {
// // color: 'orange',
// borderRadius: 65,
// label : {
// show: true,
// position: 'left',
// formatter: '{b}'
// }
// }},
barGap:'8%'
}
]
};
;
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
</script>
</body>
</html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
app.title = '世界人口总量 - 条形图';
option = {
// title : {
// text: '世界人口总量',
// subtext: '数据来自网络'
// },
// tooltip: {
// trigger: 'axis',
// // axisPointer: {
// // type: 'shadow'
// // }
// },
// legend: {
// data: ['2011年']
// },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value',
show: false,
boundaryGap: [0, 0.01],
},
yAxis: {
type: 'category',
data: ['6 招商银行','5 广发银行','4 工商银行','3 农业银行','2 中国银行','1 交通银行'],
axisLine: { show: false},
axisTick: {show: false},
},
color:['#2c3f6a','#21927e'],
series: [
{
name: '2011年',
type: 'bar',
barWidth: 15,
itemStyle: {
normal: {
barBorderRadius: 40,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: '#2d3d69'
}, {
offset: 1,
color: '#2b3c67'
}]),
// shadowColor: 'rgba(35,149,229,0.8)',
// shadowBlur: 20,
areaStyle: {type: 'default'},
label : {
show: true,
position: 'right',
formatter: function (params) {
// console.log(params)//这里输出params所有参数 需要什么下面自己拼
// return params.name + params.data;
return "¥" + params.data;
},
textStyle: {
color: '#000000'
}
},
},
},
// itemStyle: {
// // emphasis: {
// // barBorderRadius: 10
// // },
// normal: {
// label : {
// show: true,
// position: 'right',
// formatter: function (params) {
// // console.log(params)//这里输出params所有参数 需要什么下面自己拼
// // return params.name + params.data;
// return "¥" + params.data;
// },
// textStyle: {
// color: '#000000'
// }
// },
// barBorderRadius: 10,
// }
// },
data: [63023, 63023, 63023, 63023, 63023, 63023],
},
{
name: '2012年',
type: 'bar',
barWidth: 15,
itemStyle: {
normal: {
barBorderRadius: 40,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: '#0a6253'
}, {
offset: 1,
color: '#34b9a4'
}]),
// shadowColor: 'rgba(35,149,229,0.8)',
// shadowBlur: 20,
areaStyle: {type: 'default'},
label : {
show: true,
position: 'right',
formatter: function (params) {
// console.log(params)//这里输出params所有参数 需要什么下面自己拼
// return params.name + params.data;
return "¥" + params.data;
},
textStyle: {
color: '#000000'
}
},
},
},
// itemStyle: {
// normal: {
// label : {
// show: true,
// position: 'right',
// formatter: function (params) {
// // console.log(params)//这里输出params所有参数 需要什么下面自己拼
// // return params.name + params.data;
// return "¥" + params.data;
// },
// textStyle: {
// color: 'tomato'
// }
// }
// }
// },
data: [19325, 33438, 3100, 12159, 13414, 33438],
// itemStyle : { normal: {
// // color: 'orange',
// borderRadius: 65,
// label : {
// show: true,
// position: 'left',
// formatter: '{b}'
// }
// }},
barGap:'8%'
}
]
};
;
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
</script>
</body>
</html>