Skip to content

Instantly share code, notes, and snippets.

@ximan
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save ximan/f4dfd476528bbb9989dc to your computer and use it in GitHub Desktop.

Select an option

Save ximan/f4dfd476528bbb9989dc to your computer and use it in GitHub Desktop.
echarts
option = {
title : {
text: '某站点用户访问来源',
subtext: '纯属虚构',
x:'center'
},
tooltip : {
trigger: 'item',
formatter : function (a,b,c) {
var str = a[0]+' <br/>'+a[1]+' :'+a[2]+a[5].unit+'('+a[3]+'%)';
return str;
}
},
legend: {
orient : 'vertical',
x : 'left',
data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
series : [
{
name:'访问来源',
type:'pie',
radius : '55%',
center: ['50%', '60%'],
data:[
{value:335, name:'直接访问',unit:'分钟'},
{value:310, name:'邮件营销',unit:'分钟'},
{value:234, name:'联盟广告',unit:'分钟'},
{value:135, name:'视频广告',unit:'分钟'},
{value:1548, name:'搜索引擎',unit:'分钟'}
]
}
]
};
例子:http://ww2.sinaimg.cn/large/6c8ff42cgw1ellgck2pj4j21kw0pwwjz.jpg
tooltip有手动formatter的方法,你想变成啥样就啥样
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment