123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- $(document).ready(function () {
- let dom = document.getElementById("sjsq3");
- let myChart = echarts.init(dom);
- let app = {};
- let option;
- $.post(ctx + "fzjc/sjsqQssZs",function (res){
- option = {
- tooltip: {
- trigger: 'item',
- },
- series: [
- {
- name: '事件诉求',
- type: 'pie',
- radius: ['60%', '70%'],
- selectedOffset: 0, //选中块的偏移量
- label: {
- show: true,
- position: 'center',
- textStyle: {
- color: '#fff'
- },
- formatter: '{d}%'
- },
- emphasis: {
- label: {
- show: true,
- fontSize: '15',
- fontWeight: 'bold',
- color: '83bff6'
- }
- },
- labelLine: {
- show: false
- },
- data: [
- {
- value: res[1].data,
- name: res[1].name,
- itemStyle: {
- color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
- offset: 0,
- color: '#1270d9'
- }, {
- offset: 1,
- color: '#00ffeb'
- }]),
- },
- selected: true, //默认选中第一块
- label: {
- show: true, //默认显示第一块
- fontSize: '20',
- fontWeight: 'bold'
- }
- },
- {
- value: res[0].data,
- name: res[0].name,
- itemStyle: {
- color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
- offset: 0,
- color: '#ff8404'
- }, {
- offset: 1,
- color: '#ffd904'
- }]),
- }
- },
- ]
- }
- ]
- };
- if (option && typeof option === 'object') {
- myChart.setOption(option);
- myChart.on("click",function (params) {
- let prefix = ctx ;
- let url;
- /**环状图参数:1上报,2签收,3办结,4总数**/
- switch (params.name) {
- case "签收数" : url = prefix + "fzjc/goSjsqPie/2"; break;
- case "总数" : url = prefix + "fzjc/goSjsqPie/4"; break;
- }
- let btn = ['<i class="fa fa-close"></i> 关闭'];
- let options = {
- title: '签收数/总数占比',
- width: "1000",
- height: "550",
- url: url,
- btn: btn,
- callBack: doSubmit
- };
- $.modal.openOptions(options);
- });
- function doSubmit(index, layero){
- layer.close(index);
- }
- }
- });
- });
|