严智鑫
2024-05-13 cedce4883f0d204f5bf7bf87c0bf4858dabb0c23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<%@ page language="java" pageEncoding="UTF-8"%>
<!-- 原片库存 -->
<div class="modal fade" id="div_daping_chengpingbaozhuang" tabindex="-1" role="dialog"
    aria-labelledby="myModalLabel" aria-hidden="true">
    <form class="form-horizontal" role="form">
        <div class="modal-dialog" style="width: 75%;height=75%">
            <div class="modal-content" style="background-color: #d9d9d9;">
                <div class="modal-header">
                    <div class="form-group" style="margin: auto; text-align: center">
                        
 
                        <button type="button" class="btn btn-primary close"
                            data-dismiss="modal" aria-hidden="true">【关闭】</button>
                    </div>
                </div>
                <div class="modal-body" style=" width:1200px;height: 600px; display: flex;">
 
 
                    <div id="cpbz_container2" style=" width: 400px;height: 600px; float:left;"></div>
                    <div id="cpbz_container3" style=" width: 1200px;height: 600px; float:left;"></div>
                    
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </form>
</div>
 
<script>
function modalDPShow2_cpbz() {
    $("#div_daping_chengpingbaozhuang").modal('toggle');
    
    var chartDom5 = document.getElementById('cpbz_container2');
    var myChart5 = echarts.init(chartDom5);
    var option5;
    option5 = {
 
              borderColor:'#082352',
              title: {
                text:'总切裁率:'+(QCL_DY_Yuanpian[0][0]>0?(Math.round(Dy_Cl[0][0]/QCL_DY_Yuanpian[0][0] * 10000) / 100):0),//主标题文本
                        left:'center',
                        top:'50%',
                        left:'80px',
                        textStyle:{
                        fontSize: 15,
                        color:'#454c5c',
                        align:'center'
                        },
                        subtextStyle:{
                            fontFamily : "微软雅黑",
                            fontSize: 16,
                            color:'#6c7a89',
                        }
              },
              tooltip: {
                trigger: 'item'
              },
              legend: {
                // orient: 'vertical',
                left: 'left'
              },
              series: [
                {
                    type: 'pie',
                    radius : ['40%','70%'],
                    center: ['40%', '55%'],
                    minAngle:'15',
                    label: {
                    // position: 'inside',
                    show: true,
                    formatter(param) {
                      // correct the percentage
                      return param.name + ' (' + param.percent + '%)';
                    }
                },
                  data: [   
                    { value: QCL_DY_Yuanpian[0][0], name: '当月原片使用量',itemStyle:{color:'#ffffff'} },
                    { value: Dy_Cl[0][0], name: '当月产量',itemStyle:{color:'#53a2ff'} }
                  ],
                  itemStyle: {
                    normal:{
                    label:{
                        show:true,
                            //formatter: "{b} :\n  {c} \n ({d}%)",
                            formatter: "{b} :\n   ({d}%)",
                                position:"inner"
                             }
                        }
                    }
                }
              ]
            };
 
 
 
option5 && myChart5.setOption(option5);
    
    var chartDom6 = document.getElementById('cpbz_container3');      
    var myChart6 = echarts.init(chartDom6);
    var option6;
 
    option6 = {
            title: {
                text: '切裁率图',
                right: '0px',
                top: '20px'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                },
                formatter:function (params) {
                    var str='<div>';
                    var str1=params.length;
                    for(var i=0;i<str1;i++){
                        if(params[i].seriesName=="切裁率"){
                            str+=params[i].marker+params[i].seriesName + ': <span style="color: #00B83F;">'+params[i].value +'%</span></br>';
                        }else{
                            str+=params[i].marker+params[i].seriesName + ': <span style="color: #00B83F;">'+params[i].value +'</span></br>';
                        }
                        
                    }
                    str+='</div>';
                    return str;
                }
              },
              grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
              },
              xAxis: [
                {
                  type: 'category',
                  data: datashijian,
                  axisTick: {
                    alignWithLabel: true
                  },
                  axisLabel:{
                    fontSize:'12px'
                  }
                }
              ],
              yAxis: [
                {
                  type: 'value',
                  min: 0,
                  max:120,
                  interval:10
                }
              ],
              series: [
                {
                  name: '切裁率',
                  
                  type: 'bar',
                  barWidth: '40%',
                  data:bingxingtushuju11.map(function(value,index){
                      if(QCL_Yuanpian[index][0]==0||value[1]==0){
                          return 0;
                      }
                      return (Math.round(value[1]/QCL_Yuanpian[index][0] * 10000) / 100);
                  }),
                  itemStyle:{color:'#53a2ff'}
                },{
                    name: '原片使用面积',
                    type: 'bar',
                    barWidth: '0',
                    data:QCL_Yuanpian.map(v => {return v[0]}),
                    itemStyle:{color:'#53a2ff',opacity:0},      
                  },{
                      name: '产量面积',
                      type: 'bar',
                      barWidth: '0',
                      data:bingxingtushuju11.map(v => {return v[1]}),
                      itemStyle:{color:'#53a2ff',opacity:0},
                  }
                
              ]
            };
 
option6 && myChart6.setOption(option6);
}
 
    
 
 
</script>