qc.ifish7.com/Public/echarts/echarts_set.js

95 lines
1.8 KiB
JavaScript

function echarts_show(vars,theme){
var dom = document.getElementById(vars.app_id);
var myChart = echarts.init(dom,theme);
var app = {};
option = null;
app.title =vars.app_title;
option = {
tooltip: {
trigger: 'item',
},
legend: {
// orient: 'vertical',
// top: 'middle',
bottom: 10,
left: 'center',
data: ['区域代理', '普通会员','VIP会员']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
graphic:{
type:'text',
left:'center',
top:'center',
z:2,
zlevel:100,
style:{
text:vars.app_count,
fontSize:18,
x:100,
y:100,
textAlign:'center',
fill:'#fff',
width:30,
height:30,
},
},
series: [
{
name:vars.app_title,
type:'pie',
selectedMode: 'single',
radius: [0, '30%'],
label: {
normal: {
position: 'inner'
}
},
labelLine: {
normal: {
show: true
}
},
data:[
{value:vars.app_count, name:''},
]
},
{
name:'',
type:'pie',
radius: ['40%', '55%'],
label: {
normal: {
formatter: '{b|{b}:}{c} ',
backgroundColor: '',
borderColor: '#aaa',
borderWidth:0,
borderRadius: 4,
rich: {
a: {
color: '#999',
lineHeight: 12,
align: 'center'
}
}
}
},
data:vars.app_data
}
]
};;
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
}