123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
-
-
- <script src="https://cdn.bootcss.com/jquery/3.0.0/jquery.min.js"></script>
- <script type="text/javascript" src="https://assets.pyecharts.org/assets/echarts.min.js"></script>
- <script type="text/javascript" src="https://assets.pyecharts.org/assets/maps/china.js"></script>
- </head>
- <body>
-
- <div id="main" style="width: 600px;height:400px;"></div>
- <script type="text/javascript">
-
- var myChart = echarts.init(document.getElementById('main'));
- option = {
- title: {
- text: '全国地图',
- subtext: 'data from china.js',
- sublink: 'ireader.work',
- left: 'center'
- },
- geo:{
- map:'china'
- },
- tooltip : {
- trigger: 'item'
- },
- };
-
- myChart.setOption(option);
-
- myChart.hideLoading();
- $.ajax({
- url:'/getjson10',
- result:{},
- type:'GET',
- dataType:'json',
- success:function(result){
-
-
- myChart.setOption({
- backgroundColor: '#FFFFFF',
- title: {
- text: '地域分布',
- top: 14,
- left: 14,
- textStyle: {
- borderColor: '#333333',
- fontWeight: 400,
- fontFamily: 'PingFangSC-Regular, PingFang SC',
- color: '#666666',
- fontSize: 14
- }
- },
- tooltip: {
- trigger: 'item',
- show: true,
- formatter: function(params) {
-
- return params.name + ':' + params.data['value']
- }
- },
-
- visualMap: {
- show: false,
- x: 'left',
- y: 'center',
- min: 0,
- max: 50000,
- color: ['#0019ff', '#ffffff']
- },
-
- series: [{
- name: '数据',
- type: 'map',
- mapType: 'china',
- roam: false,
- label: {
- normal: {
- show: false
- },
- emphasis: {
- show: false
- }
- },
- itemStyle: {
- normal: {
-
- borderColor: 'transparent',
- label: {
- show: true
- }
- },
- emphasis: {
- areaColor: '#49FFE9',
- shadowColor: 'rgba(0,0,0,0.2)',
- shadowOffsetX: 0,
- shadowOffsetY: 4,
- shadowBlur: 8,
- label: {
- show: true,
- textStyle: {
- color: '#fff'
- }
- }
- }
- },
- data:result
- }]
- });
- },
- error:function (msg) {
- console.log(msg);
- alert('系统发生错误');
- }
- })
- </script>
- </body>
- </html>
|