area_echarts.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. function echarts_map() {
  2. var myChart = echarts.init(document.getElementById('map'));
  3. var uploadedDataURL = "js/440300.json";
  4. var name = '';
  5. $.get(uploadedDataURL, function(geoJson) {
  6. echarts.registerMap(name, geoJson);//注册 地图
  7. myChart.setOption(option = {
  8. title : {
  9. text: '广东省深圳市行政区划示意图',
  10. subtext: '地图对应相应的json文件',
  11. left: 'center',
  12. top:30,
  13. textStyle : {
  14. color: '#fff'
  15. }
  16. },
  17. series: [{
  18. type: 'map',
  19. mapType: name,
  20. label: {
  21. normal: {
  22. show:true,
  23. textStyle: {
  24. color: '#fff'
  25. }
  26. },
  27. emphasis: {
  28. show:true,
  29. textStyle: {
  30. color: '#fff'
  31. }
  32. }
  33. },
  34. itemStyle: {
  35. normal: {
  36. areaColor: '#4c60ff',
  37. borderColor: '#002097'
  38. },
  39. emphasis: {
  40. areaColor: '#293fff'
  41. }
  42. },
  43. animation: false,
  44. data: []
  45. }]
  46. });
  47. });
  48. }
  49. $(window).load(function(){
  50. echarts_map()
  51. })
  52. // })