lines-symbol.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <html>
  2. <head>
  3. <meta charset='utf-8'>
  4. <script src='lib/esl.js'></script>
  5. <script src='lib/config.js'></script>
  6. <script src='lib/jquery.min.js'></script>
  7. <script src='http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM'></script>
  8. <meta name='viewport' content='width=device-width, initial-scale=1' />
  9. </head>
  10. <body>
  11. <style>
  12. html, body, #main {
  13. width: 100%;
  14. height: 100%;
  15. margin: 0;
  16. }
  17. </style>
  18. <div id='main'></div>
  19. <script>
  20. require([
  21. 'echarts'
  22. // 'echarts/chart/lines',
  23. // 'echarts/chart/effectScatter',
  24. // 'echarts/component/legend',
  25. // 'echarts/component/geo'
  26. ], function (echarts) {
  27. $.get('../map/json/china.json', function (chinaJson) {
  28. echarts.registerMap('china', chinaJson);
  29. var myChart = echarts.init(document.getElementById('main'));
  30. var planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';
  31. var option = {
  32. geo: {
  33. map: 'china',
  34. roam: true
  35. },
  36. legend: {
  37. show: true,
  38. data: ['a', 'b']
  39. },
  40. series: [{
  41. name: 'a',
  42. type: 'lines',
  43. coordinateSystem: 'geo',
  44. polyline: true,
  45. effect: {
  46. show: true,
  47. period: 8,
  48. color: '#4433aa',
  49. symbolSize: 20,
  50. symbol: planePath
  51. },
  52. zlevel: 1,
  53. lineStyle: {
  54. normal: {
  55. width: 4,
  56. opacity: 0.2
  57. }
  58. },
  59. data: [{
  60. coords: [
  61. [100.5107, 23.2196],
  62. [120.5107, 23.2196]
  63. ],
  64. lineStyle: {
  65. normal: {
  66. curveness: 0.2
  67. }
  68. }
  69. }, {
  70. coords: [
  71. [100.5107, 30.2196],
  72. [100.5107, 32.2196],
  73. [110.5107, 34.2196],
  74. [112.5107, 38.2196],
  75. [104.5107, 30.2196],
  76. [100.5107, 30.2196]
  77. ]
  78. }]
  79. },
  80. {
  81. name: 'b',
  82. type: 'lines',
  83. coordinateSystem: 'geo',
  84. effect: {
  85. show: true,
  86. period: 4,
  87. color: '#4433aa',
  88. symbolSize: 20,
  89. symbol: planePath
  90. },
  91. zlevel: 1,
  92. data: [{
  93. coords: [
  94. [100.5107, 23.2196],
  95. [120.5107, 23.2196]
  96. ],
  97. lineStyle: {
  98. normal: {
  99. curveness: 0.2,
  100. width: 4,
  101. opacity: 0.4
  102. }
  103. }
  104. }]
  105. }]
  106. }
  107. myChart.setOption(option);
  108. });
  109. });
  110. </script>
  111. </body>
  112. </html>