option = {
tooltip : {
trigger: 'axis'
},
legend: {
data:['邮件营销','联盟广告','直接访问','搜索引擎']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
type : 'category',
boundaryGap : false,
data : ['周一','周二','周三','周四','周五','周六','周日']
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'邮件营销',
type:'bar',
stack: '总量',
symbol: 'none',
itemStyle: {
normal: {
// 区域图,纵向渐变填充
color : (function (){
var zrColor = require('zrender/tool/color');
return zrColor.getLinearGradient(
0,150, 0,300,
[[0, '#46aaff'],[1, '#ff0000']]
)
})()
}
},
data:[
120, 132, 301, 134, 230, 210
]
}
]
};