-
Notifications
You must be signed in to change notification settings - Fork 4
/
数据 2019_1.html
executable file
·913 lines (885 loc) · 32.6 KB
/
数据 2019_1.html
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Enron</title>
<link rel="stylesheet" href="css/juece.css">
<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="js/echarts.js"></script>
<script type="text/javascript" src="js/echarts-liquidfill.js"></script>
<!-- <script type="text/javascript" src="js/juece.js"></script>-->
<script type="text/javascript" src="js/echarts-wordcloud.js"></script>
<script type="text/javascript"
src="http://api.map.baidu.com/api?v=2.0&ak=39b5eb8bb91adccfa6487135d960a1e8"></script>
<!-- <script src='https://cdn.bootcss.com/echarts/3.7.2/echarts.simple.js'></script>-->
<!-- <script src='./dist/echarts-wordcloud.js'></script>-->
<script type="text/javascript">
<!--
$(window).resize(function ()// 绑定到窗口的这个事件中
{
// var whdef = 100/1920;// 表示1920的设计图,使用100PX的默认值
var whdef = 100 / 916;// 表示1920的设计图,使用100PX的默认值
var wH = window.innerHeight;// 当前窗口的高度
var wW = window.innerWidth;// 当前窗口的宽度
// var rem = wW * whdef;// 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
var rem = wH * whdef;// 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
$('html').css('font-size', rem + "px");
myChart1.resize();
myChart2.resize();
myChart3.resize();
myChart4.resize();
});
//-->
</script>
</head>
<body>
<div class="container">
<header>
<div class="herder_bg"></div>
<a id="switch_btn" href="数据%202019_2.html"></a>
</header>
<article>
<div id="hideleft"></div>
<div id="hideright"></div>
<div class="wrap">
<div class="center">
<div id="ec3" style="width: 98%;height: 97%; margin-left: 1%;top: 1.5%;"></div>
</div>
</div>
<div class="left_margin box-div">
<div class="sun-div">
<div class="sun-title"><span class="">爬取数据概览</span></div>
<div id="ec1" class="left-ec"></div>
</div>
<div class="sun-div">
<div class="sun-title"><span class="">中美贸易摩擦三年热度情况</span></div>
<div id="ec2" class="left-ec"></div>
</div>
<div class="sun-div div_btm">
<div class="sun-title"><span class="">关注中美贸易摩擦男女比例分布</span></div>
<div id="ec4" class="left-ec"></div>
</div>
</div>
<div class="right_margin box-div">
<div class="sun-div">
<div class="sun-title"><span class="">中美贸易战涉及热门国家</span></div>
<ul class="data-contents-height">
<li><b>1</b><b class="litext" title="灞桥天骄幼儿园">中国</b>
<span class="r unchanged"><strong>92k次</strong></span></li>
<li><b>2</b><b class="litext" title="星海柏林阳光幼儿园">美国</b>
<span class="r unchanged"><strong>80k次</strong></span></li>
<li><b>3</b><b class="litext" title="灞桥区小天鹅幼儿园">日本</b>
<span class="r unchanged"><strong>55k次</strong></span></li>
<li><b>4</b><b class="litext" title="灞桥区白鹿幼儿园">欧洲</b>
<span class="r unchanged"><strong>11k次</strong></span>
<li><b>5</b><b class="litext" title="灞桥区白红太阳幼儿园">俄罗斯</b>
<span class="r unchanged"><strong>9201次</strong></span></li>
<li><b>6</b><b class="litext" title="灞桥区白红太阳幼儿园">英国</b>
<span class="r unchanged"><strong>7321次</strong></span></li>
</ul>
</div>
<div class="sun-div">
<div class="sun-title"><span class="">中美贸易战涉及热门人物</span></div>
<ul class="data-contents-height" id="jlTop">
<li><b>1</b><b class="litext" title="灞桥天骄幼儿园">特朗普</b>
<span class="r unchanged"><strong>60k次</strong></span></li>
<li><b>2</b><b class="litext" title="星海柏林阳光幼儿园">习近平</b>
<span class="r unchanged"><strong>42k次</strong></span></li>
<li><b>3</b><b class="litext" title="灞桥区小天鹅幼儿园">王毅</b>
<span class="r unchanged"><strong>21k次</strong></span></li>
<li><b>4</b><b class="litext" title="灞桥区白鹿幼儿园">莱特西泽</b>
<span class="r unchanged"><strong>9200次</strong></span>
</li>
<li><b>5</b><b class="litext" title="灞桥区白红太阳幼儿园">蓬佩奥</b>
<span class="r unchanged"><strong>8300次</strong></span></li>
<li><b>6</b><b class="litext" title="灞桥区白红太阳幼儿园">奥巴马</b>
<span class="r unchanged"><strong>2100次</strong></span></li>
</ul>
</div>
<div class="sun-div div_btm">
<div class="sun-title"><span class="">中美贸易战涉及热门机构</span></div>
<ul class="data-contents-height" id="gmTop">
<li><b>1</b>
<b class="litext" title="灞桥天骄幼儿园">中国政府</b>
<span class="r unchanged"><strong>53k次</strong></span></li>
<li><b>2</b><b class="litext" title="星海柏林阳光幼儿园">美国政府</b>
<span class="r unchanged"><strong>48k次</strong></span></li>
<li><b>3</b><b class="litext" title="灞桥区白鹿幼儿园">华为公司</b>
<span class="r unchanged"><strong>47k次</strong></span></li>
<li><b>4</b><b class="litext" title="灞桥区白鹿幼儿园">国际货币基金组织</b>
<span class="r unchanged"><strong>21k次</strong></span></li>
<li><b>5</b><b class="litext" title="灞桥区白红太阳幼儿园">中国外交部</b>
<span class="r unchanged"><strong>9867次</strong></span></li>
<li><b>6</b><b class="litext" title="灞桥区白红太阳幼儿园">世界贸易组织</b>
<span class="r unchanged"><strong>7655次</strong></span></li>
</ul>
</div>
</div>
</article>
</div>
<script type="text/javascript">
var myChart1 = echarts.init(document.getElementById('ec1'));
var myChart2 = echarts.init(document.getElementById('ec2'));
var myChart3 = echarts.init(document.getElementById('ec3'));
var myChart4 = echarts.init(document.getElementById('ec4'));
$(function () {
$("#hideleft").toggle(
function () {
$(".left_margin").animate({marginLeft: "-125%"});
$(".wrap").animate({marginLeft: 0});
$(".center").animate({marginLeft: 0});
},
function () {
$(".center").animate({marginLeft: "0%"});
$(".left_margin").animate({marginLeft: "-100%"});
}
);
$("#hideright").toggle(
function () {
$(".right_margin").animate({marginRight: "25%"});
$(".wrap").animate({marginRight: 0});
$(".center").animate({marginRight: 0});
},
function () {
$(".center").animate({marginRight: "-25%"});
$(".right_margin").animate({marginRight: "-25%"});
}
);
});
</script>
<script>
var laber = ["弱", '相关性', '强', " ", '强', '相关性', '弱'];
option = {
"xAxis": [{
zlevel: 20,
type: 'value',
min: -50,
max: 50,
interval: 16.7,
axisLabel: {
margin: -150,
formatter: function (value, index) {
return laber[index]
},
lineStyle: {
color: '#FCCE10'
}
},
splitLine: {
show: false,
},
splitArea: {
show: false,
},
}],
"yAxis": [{
"min": -50,
"max": 50,
"show": false,
"splitLine": {
"show": false
},
"splitArea": {
"show": false
}
}],
"legend": {
"show": false,
"data": []
},
"tooltip": {
"showContent": false
},
"sendDataSetting": {
"selectParams": false,
"selectCell": false
},
"visualMap": [{
"show": false,
"dimension": 2,
"min": 1,
"max": 3,
"precision": 0.01,
// "inRange": {
// "symbolSize": [10, 50]
// }
}],
"series": [
{
zlevel: 20,
type: 'scatter',
symbol: 'circle',
symbolSize: 150,
label: {
normal: {
show: true,
formatter: function (param) {
return param.data[2];
},
},
},
itemStyle: {
normal: {
color: "#4263FF",
},
},
data: [
[-1, 0, '中美贸易战', '#FCCE10', 25]
],
}, {
zlevel: 20,
name: '国家',
type: 'scatter',
symbol: 'circle',
symbolSize: function (param, a) {
return param[4];
},
itemStyle: {
normal: {
color: function (param) {
return param.data[3];
},
},
},
label: {
color: '#FCCE10',
normal: {
textStyle: {
fontSize: 15,
},
position: 'bottom',
show: true,
formatter: function (param) {
return param.data[2];
},
},
},
"data": [
[-40, -41, "俄罗斯", '#FCCE10', 15],
[-50, -36, "印度", '#FCCE10', 5],
[-31, 12, "德国", '#FCCE10', 15],
[17, -46, "加拿大", '#FCCE10', 15],
[47, -36, "墨西哥", '#FCCE10', 15],
[-8, 34, "欧洲", '#FCCE10', 25],
[-45, -3, "韩国", '#FCCE10', 5],
[-11, -7, "美国", '#FCCE10', 45],
[-2, -34, "日本", '#FCCE10', 20],
[32, 34, "英国", '#FCCE10', 10],
[4, 11, "中国", '#FCCE10', 45],
],
"markLine": {}
}, {
"name": "机构",
"zlevel": 20,
"type": "scatter",
"symbol": "circle",
"itemStyle": {
"normal": {}
},
label: {
color: "#FCB03d",
normal: {
textStyle: {
fontSize: 8
},
position: 'bottom',
show: true,
formatter: function (param) {
return param.data[2];
},
}
},
data: [
[6, -30, "中国外交部", "#FCB03d", 25],
[19, -23, "世界贸易组织", "#FCB03d", 15],
[23, 33, "新华社", "#FCB03d", 25],
[-3, 44, "国际货币基金组织", "#FCB03d", 15],
[-12, 12, "中国政府", "#FCB03d", 35],
[12, -23, "美国政府", "#FCB03d", 30],
],
},
{
zlevel: 20,
name: '人物',
type: 'scatter',
symbol: 'circle',
symbolSize: function (param, a) {
return param[4];
},
itemStyle: {
normal: {
color: function (param) {
return param.data[3];
},
},
},
label: {
color: '#FCCE10',
normal: {
textStyle: {
fontSize: 8,
},
position: 'bottom',
show: true,
formatter: function (param) {
return param.data[2];
},
},
},
"data": [
[47, 0, "陆慷", '#FCCE10', 25],
[-50, -36, "印度", '#FCCE10', 15],
[-27, 4, "刘鹤", '#FCCE10', 25],
[1, -46, "加拿大", '#FCCE10', 15],
[47, -36, "墨西哥", '#FCCE10', 15],
[5, 34, "莱特西泽", '#FCCE10', 25],
[-45, -3, "韩国", '#FCCE10', 5],
[13, 13, "习近平",'#FCCE10', 35],
[-5, -30, "奥巴马", '#FCCE10', 20],
[32, 34, "英国", '#FCCE10', 10],
[13, -8, "特朗普", '#FCCE10', 25],
],
"markLine": {}
},
{
"type": "pie",
"radius": ["0", "45%"],
"center": ["50%", "50%"],
"zlevel": 2,
"avoidLabelOverlap": false,
"label": {
"normal": {
"show": false,
"position": "center"
},
"emphasis": {
"show": false,
"textStyle": {
"fontWeight": "bold"
}
}
},
"itemStyle": {
"normal": {
"color": {
"type": "linear",
"x": 0,
"y": 0,
"x2": 0,
"y2": 1,
"colorStops": [{
"offset": 0.05,
"color": "#86AFFB"
}, {
"offset": 0.5,
"color": '#4381F3'
}, {
"offset": 0.95,
"color": "#86AFFB"
}]
}
}
},
"labelLine": {
"normal": {
"show": false
}
},
"data": [{
"value": 3357
}]
}, {
"type": "pie",
"radius": ["0%", "90%"],
"center": ["50%", "50%"],
"avoidLabelOverlap": false,
"label": {
"normal": {
"show": false,
"position": "center"
},
"emphasis": {
"show": false,
"textStyle": {
"fontWeight": "bold"
}
}
},
"itemStyle": {
"normal": {
"color": {
"type": "linear",
"x": 0,
"y": 0,
"x2": 0,
"y2": 1,
"colorStops": [{
"offset": 0.1,
"color": "rgba(130,198,255, 0)"
}, {
"offset": 0.5,
"color": '#0669D1'
}, {
"offset": 0.9,
"color": "rgba(130,198,255, 0)"
}]
}
}
},
"labelLine": {
"normal": {
"show": false
}
},
"data": [{
"value": 3235
}]
}, {
"type": "pie",
"radius": ["0%", "135%"],
"center": ["51%", "50%"],
"avoidLabelOverlap": false,
"label": {
"normal": {
"show": false,
"position": "center"
},
"emphasis": {
"show": false,
"textStyle": {
"fontWeight": "bold"
}
}
},
"itemStyle": {
"normal": {
"color": {
"type": "linear",
"x": 0,
"y": 0,
"x2": 0,
"y2": 1,
"colorStops": [{
"offset": 0.2,
"color": "rgba(130,198,255, 0.0)"
}, {
"offset": 0.5,
"color": "rgba(130,198,255, 0.2)"
}, {
"offset": 0.88,
"color": "rgba(130,198,255, 0.0)"
}]
}
}
},
"labelLine": {
"normal": {
"show": false
}
},
"data": [{
"value": 3235
}]
}],
};
myChart3.setOption(option)
</script>
<!--主图-->
<script>
var val1data2 = [{
value: 74351,
name: '微博',
},
{
value: 10549,
name: 'Twitter',
},
{
value: 5000,
name: '知乎',
},
{
value: 212,
name: '搜狗新闻',
},
{
value: 230,
name: '今日头条',
},
{
value: 520,
name: '中新网',
},
{
value: 618,
name: '百度新闻',
},
]
var arr = ['middleLost', 0.8, val1data2, '爬取数据总量']
option = {
title: {
top: '45%',
left: 'center',
text: arr[3],
textStyle: {
color: '#ffffff',
fontStyle: 'normal',
fontWeight: 'normal',
fontSize: 14
},
subtext: '(110000 篇)',
subtextStyle: {
color: 'red',
fontSize: 12
}
},
tooltip: {
trigger: 'item',
formatter: function (res) {
console.log(res)
if (res.componentSubType == 'liquidFill') {
return res.seriesName + ': 110000';
} else {
return '<span class="ii" style="background:' + res.color + ' "></span>' + res.name + ':<br/> ' + res.data.value;
}
}
},
series: [{
type: 'liquidFill',
itemStyle: {
normal: {
opacity: 0.4,
shadowBlur: 0,
shadowColor: 'blue'
}
},
name: arr[3],
data: [0.8, {
value: 0.6,
direction: 'left',
itemStyle: {
color: 'blue'
}
}, 0.5, 0.3],
// background: '#fff',
color: ['#53d5ff'],
center: ['50%', '50%'],
/* backgroundStyle: {
color: '#fff'
},*/
label: {
normal: {
formatter: '',
textStyle: {
fontSize: 12
}
}
},
outline: {
itemStyle: {
borderColor: '#86c5ff',
borderWidth: 0
},
borderDistance: 0
}
},
{
type: 'pie',
radius: ['42%', '50%'],
color: ['#c487ee', '#deb140', '#49dff0', '#ffffff', '#6f81da', '#00ffb4'],
hoverAnimation: false, ////设置饼图默认的展开样式
label: {
show: true,
normal: {
formatter: '{b}\n{d}%',
show: true,
position: ''
},
},
labelLine: {
normal: {
show: false
}
},
itemStyle: { // 此配置
normal: {
borderWidth: 2,
borderColor: '#fff',
},
emphasis: {
borderWidth: 0,
shadowBlur: 2,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
data: arr[2]
}
]
}
myChart1.setOption(option);
</script>
<!--饼图-->
<script type="text/javascript">
var symbols = [
'path://M18.2629891,11.7131596 L6.8091608,11.7131596 C1.6685112,11.7131596 0,13.032145 0,18.6237673 L0,34.9928467 C0,38.1719847 4.28388932,38.1719847 4.28388932,34.9928467 L4.65591984,20.0216948 L5.74941883,20.0216948 L5.74941883,61.000787 C5.74941883,65.2508314 11.5891201,65.1268798 11.5891201,61.000787 L11.9611506,37.2137775 L13.1110872,37.2137775 L13.4831177,61.000787 C13.4831177,65.1268798 19.3114787,65.2508314 19.3114787,61.000787 L19.3114787,20.0216948 L20.4162301,20.0216948 L20.7882606,34.9928467 C20.7882606,38.1719847 25.0721499,38.1719847 25.0721499,34.9928467 L25.0721499,18.6237673 C25.0721499,13.032145 23.4038145,11.7131596 18.2629891,11.7131596 M12.5361629,1.11022302e-13 C15.4784742,1.11022302e-13 17.8684539,2.38997966 17.8684539,5.33237894 C17.8684539,8.27469031 15.4784742,10.66467 12.5361629,10.66467 C9.59376358,10.66467 7.20378392,8.27469031 7.20378392,5.33237894 C7.20378392,2.38997966 9.59376358,1.11022302e-13 12.5361629,1.11022302e-13',
'path://M28.9624207,31.5315864 L24.4142575,16.4793596 C23.5227152,13.8063773 20.8817445,11.7111088 17.0107398,11.7111088 L12.112691,11.7111088 C8.24168636,11.7111088 5.60080331,13.8064652 4.70917331,16.4793596 L0.149791395,31.5315864 C-0.786976655,34.7595013 2.9373074,35.9147532 3.9192135,32.890727 L8.72689855,19.1296485 L9.2799493,19.1296485 C9.2799493,19.1296485 2.95992025,43.7750224 2.70031069,44.6924335 C2.56498417,45.1567684 2.74553639,45.4852068 3.24205501,45.4852068 L8.704461,45.4852068 L8.704461,61.6700801 C8.704461,64.9659872 13.625035,64.9659872 13.625035,61.6700801 L13.625035,45.360657 L15.5097899,45.360657 L15.4984835,61.6700801 C15.4984835,64.9659872 20.4191451,64.9659872 20.4191451,61.6700801 L20.4191451,45.4852068 L25.8814635,45.4852068 C26.3667633,45.4852068 26.5586219,45.1567684 26.4345142,44.6924335 C26.1636859,43.7750224 19.8436568,19.1296485 19.8436568,19.1296485 L20.3966199,19.1296485 L25.2043926,32.890727 C26.1862111,35.9147532 29.9105828,34.7595013 28.9625083,31.5315864 L28.9624207,31.5315864 Z M14.5617154,0 C17.4960397,0 19.8773132,2.3898427 19.8773132,5.33453001 C19.8773132,8.27930527 17.4960397,10.66906 14.5617154,10.66906 C11.6274788,10.66906 9.24611767,8.27930527 9.24611767,5.33453001 C9.24611767,2.3898427 11.6274788,0 14.5617154,0 L14.5617154,0 Z',
'path://M512 292.205897c80.855572 0 146.358821-65.503248 146.358821-146.358821C658.358821 65.503248 592.855572 0 512 0 431.144428 0 365.641179 65.503248 365.641179 146.358821 365.641179 227.214393 431.144428 292.205897 512 292.205897zM512 731.282359c-80.855572 0-146.358821 65.503248-146.358821 146.358821 0 80.855572 65.503248 146.358821 146.358821 146.358821 80.855572 0 146.358821-65.503248 146.358821-146.358821C658.358821 796.273863 592.855572 731.282359 512 731.282359z'
];
var bodyMax = 48912; //指定图形界限的值
var labelSetting = {
normal: {
show: true,
position: 'bottom',
offset: [0, 10],
formatter: function (param) {
return (param.value / bodyMax * 100).toFixed(0) + '%';
},
textStyle: {
fontSize: 18,
fontFamily: 'Arial',
color: '#686868'
}
}
};
var markLineSetting = { //设置标线
symbol: 'none',
lineStyle: {
normal: {
opacity: 0.3
}
},
data: [{
type: 'max',
label: {
normal: {
formatter: 'max: {c}'
}
}
}, {
type: 'min',
label: {
normal: {
formatter: 'min: {c}'
}
}
}]
};
option = {
tooltip: {
show: false, //鼠标放上去显示悬浮数据
},
legend: {
data: ['关注中美贸易战男女比例'],
selectedMode: 'single',
itemWidth: 10, //图例的宽度
itemHeight: 10, //图例的高度
itemGap: 30,
orient: 'horizontal',
left: 'center',
top: '0px',
icon: 'rect',
// selectedMode: false, //取消图例上的点击事件
textStyle: {
color: '#808492'
},
},
grid: {
// left: '20%',
// right: '20%',
top: '20%',
bottom: '20%',
containLabel: true
},
xAxis: {
data: ['a', 'x', 'b'],
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: false
}
},
yAxis: {
max: bodyMax,
splitLine: {
show: false
},
axisTick: {
// 刻度线
show: false
},
axisLine: {
// 轴线
show: false
},
axisLabel: {
// 轴坐标文字
show: false
}
},
series: [{
name: '关注中美贸易战男女比例',
type: 'pictorialBar',
symbolClip: true,
symbolBoundingData: bodyMax,
label: labelSetting,
data: [{
value: 40687,
symbol: symbols[0],
itemStyle: {
normal: {
color: 'rgba(105,204,230)' //单独控制颜色
}
},
},
{},
{
value: 8225,
symbol: symbols[1],
itemStyle: {
normal: {
color: 'rgba(255,130,130)' //单独控制颜色
}
},
}
],
// markLine: markLineSetting,
z: 10
},
{
// 设置背景底色,不同的情况用这个
name: 'full',
type: 'pictorialBar', //异型柱状图 图片、SVG PathData
symbolBoundingData: bodyMax,
animationDuration: 0,
itemStyle: {
normal: {
color: '#ccc' //设置全部颜色,统一设置
}
},
z: 10,
data: [{
itemStyle: {
normal: {
color: 'rgba(105,204,230,0.40)' //单独控制颜色
}
},
value: 100,
symbol: symbols[0]
},
{
// 设置中间冒号
itemStyle: {
normal: {
color: '#1DA1F2' //单独控制颜色
}
},
value: 100,
symbol: symbols[2],
symbolSize: [8, '18%'],
symbolOffset: [0, '-200%']
},
{
itemStyle: {
normal: {
color: 'rgba(255,130,130,0.40)' //单独控制颜色
}
},
value: 100,
symbol: symbols[1]
}
]
}
]
}
myChart4.setOption(option)
</script>
<!--男女比例-->
<script type="text/javascript">
var title, data, data1, data2;
data1 = ['1 月', '2 月', '3 月', '4 月', '5 月', '6 月', '7 月', '8 月', '9 月', '10 月', '11 月', '12 月'];
//教育
// title="医疗机构数量变化趋势";
data = ['2017', '2018', '2019'];
data2 = [{value: 35, name: '综合医院'}, {value: 10, name: '村卫生室'}, {value: 23, name: '中医诊所'}, {
value: 35,
name: '社区卫生服务站'
}, {value: 5, name: '普通诊所'}];
var option2 = {
tooltip: {
trigger: 'axis'
},
legend: {
y: 'top',
data: data,
textStyle: {
color: '#E87C25'
}
},
calculable: true,
grid: {
x: 40,
y: 30,
x2: 20,
height: '70%'
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: data1,
axisLabel: {
textStyle: {
color: '#6cbbe6'
}
}
}
],
yAxis: [
{
type: 'value',
axisLabel: {
textStyle: {
color: '#6cbbe6'
}
}
}
],
series: [
{
name: '2017',
type: 'line',
stack: '总数',
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data: [120, 130, 200, 350, 460, 401, 321, 534, 567, 321, 567, 500]
},
{
name: '2018',
type: 'line',
stack: '总数',
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data: [1200, 3000, 42000, 30000, 20000, 25000, 15000, 8500, 7000, 3200, 2300, 2300]
},
{
name: '2019',
type: 'line',
stack: '总数',
itemStyle: {normal: {areaStyle: {type: 'default'}}},
data: [250, 240, 300, 2600, 1500, 9000, 30000, 15000, 40000, 10000, 3000, 2000]
}
]
};
myChart2.clear();
myChart2.setOption(option2);
</script>
<!--折线图-->
</body>
</html>