echar饼状图在区域名字后显示值及其百分比

<!DOCTYPE html> <head> <metacharset="utf-8"> <title>ECharts</title> </head> <body> <!-- 为ECharts准备一个具备大小(宽高)的Dom --> <divid="main"style="height:400px"></div> <!-- ECharts单文件引入 --> <script src="http://echarts.baidu.com/build/dist/echarts.js"></script> <scripttype="text/javascript"> // 路径配置 require.config({ paths: { echarts: 'http://echarts.baidu.com/build/dist' } }); // 使用 require( [ 'echarts', 'echarts/chart/bar' // 使用柱状图就加载bar模块,按需加载 ], function (ec) { // 基于准备好的dom,初始化echarts图表 var myChart = ec.init(document.getElementById('main')); option = { title : { text: '地区生成总值产业构成', x:'center', y:'top',textStyle:{fontFamily:'Microsoft Yahei'}, link: 'javascript:f_open(option03)', target:'self' }, //提示框,鼠标悬浮交互时的信息提示 tooltip : { trigger: 'item', formatter: "{a} <br/>{b} : {c} ({d}%)" }, toolbox: { show : true }, calculable : true, series : [ { name:'地区生成总值', type:'pie', radius : '55%',center: ['50%', '60%'], itemStyle : { normal : {label : { show:true, textStyle : { fontFamily: 'Microsoft YaHei', fontSize : '12', fontWeight : 'bold'}, formatter: "{b} : {c} 亿元\n{d}%"//在区域名字后显示值及其百分比 }, labelLine:{show:true} },}, data:[ {value:15.2, name:'大港街'}, {value:9.5, name:'华尔街'}, {value:12, name:'步行街'}, {value:3.8, name:'经济区'}, ] } ] }; // 为echarts对象加载数据myChart.setOption(option);} ); </script> </body>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值