Echarts3简单图标是咧

 
 
这个是基于Echarts3做的柱形图,折线图,饼形图,中间还有自定义图标
<div style="margin-left: auto;margin-right: auto">
<div id="mainleft" style="height:300px;border:1px solid #ccc;padding:10px;width: 550px;float: left;"></div>
<div id="mainright" style="height:300px;border:1px solid #ccc;padding:10px;width: 550px;float: right;">aaa</div>
</div>
<script src="${ctxStatic}/echarts/echarts.min.js"></script>
<script type="text/javascript">
var workTodayCount;
var myChart;
$(document).ready(function() {
workTodayCount = ${fns:toJson(workTodayCount)};
pie(workTodayCount);
bar(workTodayCount);
});
function bar(workTodayCount){
myChart = echarts.init(document.getElementById('mainleft'));
if(!workTodayCount){
myChart.showLoading({
text: '正在努力加载中...'
});
}
myChart.setOption({
title: {
text: '今日工作',
left:'left'
},
toolbox: {
show : true,
feature : {
//折线,柱形
magicType : {show: true, type: ['line', 'bar']},
//自定义饼形
myTool2: {
show: true,
title: '饼形图切换',
icon: 'image://http://echarts.baidu.com/images/favicon.png',
onclick: function (){
pie(workTodayCount);
}
},
//换原
restore : {show: true},
//保存
saveAsImage : {show: true}
}
},
xAxis: {
data: [workTodayCount.pfsString,workTodayCount.zcpfsString,workTodayCount.bylasString,workTodayCount.hfsString,workTodayCount.hbsString]
},
yAxis : [{
type : 'value',
splitArea : {show : true}
}],
series: [{
name: '今日工作',
type: 'bar',
data: [workTodayCount.pfs,workTodayCount.zcpfs,workTodayCount.bylas,workTodayCount.hfs,workTodayCount.hbs]
}]
});
}
function pie(workTodayCount){
myChart = echarts.init(document.getElementById('mainright'));
if(!workTodayCount){
myChart.showLoading({
text: '正在努力加载中...'
});
}
myChart.setOption({
title: {
text: '今日工作'
},
tooltip : {
trigger: '今日工作',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
toolbox: {
show : true,
feature : {
mark : {show: true},
magicType : {
show: true,
type: ['pie', 'tiled']
},
myTool2: {
show: true,
title: '柱形图切换',
icon: 'image://http://echarts.baidu.com/images/favicon.png',
onclick: function (){
bar(workTodayCount);
}
},
restore : {show: true},
saveAsImage : {show: true}
}
},
series : [
{
name:'今日工作',
type:'pie',
radius : '65%',
data:[
{value:workTodayCount.pfs, name:workTodayCount.pfsString},
{value:workTodayCount.zcpfs, name:workTodayCount.zcpfsString},
{value:workTodayCount.bylas, name:workTodayCount.bylasString},
{value:workTodayCount.hfs, name:workTodayCount.hfsString},
{value:workTodayCount.hbs, name:workTodayCount.hbsString}
]
}
]
});
}
</script>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值