当前位置:   article > 正文

mars3d与echart图表结合使用_mars3d-echarts

mars3d-echarts

创建一个echart图层,装载echart图表;

options就是echart图表的设置参数;

  1. const options = getEchartsOption()
  2. const echartsLayer = new mars3d.layer.EchartsLayer(options)
  3. map.addLayer(echartsLayer)
  1. // echart 图表的参数
  2. function getEchartsOption() {
  3. const options = {
  4. animation: false,
  5. visualMap: { min: 0, max: 15, bottom: "5%", right: "5%", itemHeight: 30, show: true },
  6. series: [
  7. {
  8. type: "effectScatter",
  9. coordinateSystem: "mars3dMap",
  10. showEffectOn: "render",
  11. zlevel: 0,
  12. rippleEffect: { period: 15, scale: 4, brushType: "fill" },
  13. label: { normal: { show: true, formatter: "{b}", position: "top", offset: [5, 0], color: "#1DE9B6" }, emphasis: { show: true } },
  14. symbol: "circle",
  15. itemStyle: { normal: { show: true, shadowBlur: 10, shadowColor: "#333" } },
  16. data: [
  17. { key: "中国", name: "中国", latitudeAndLongitude: "110.094854,34.525002", counts: 15, value: [110.094854, 34.525002, 15] },
  18. { key: "澳大利亚", name: "澳大利亚", latitudeAndLongitude: "150.993137,-33.675509", counts: 6, value: [150.993137, -33.675509, 6] },
  19. { key: "蒙古", name: "蒙古", latitudeAndLongitude: "106.731711, 48.056936", counts: 3, value: [106.731711, 48.056936, 3] },
  20. { key: "泰国", name: "泰国", latitudeAndLongitude: "100.52901, 13.814341", counts: 3, value: [100.52901, 13.814341, 3] },
  21. { key: "韩国", name: "韩国", latitudeAndLongitude: "126.928257, 37.617069", counts: 3, value: [126.928257, 37.617069, 3] },
  22. { key: "匈牙利", name: "匈牙利", latitudeAndLongitude: "17.108519,48.179162", counts: 3, value: [17.108519, 48.179162, 3] },
  23. { key: "阿联酋", name: "阿联酋", latitudeAndLongitude: "55.269441,25.204514", counts: 3, value: [55.269441, 25.204514, 3] }
  24. ]
  25. },
  26. {
  27. type: "lines",
  28. coordinateSystem: "mars3dMap",
  29. zlevel: 0,
  30. effect: { show: true, period: 4, trailLength: 0.2, symbol: "arrow", symbolSize: 5 },
  31. lineStyle: { normal: { width: 1, opacity: 1, curveness: 0.3 } },
  32. // 位置信息
  33. data: [
  34. {
  35. coords: [
  36. [17.108519, 48.179162],
  37. [55.269441, 25.204514]
  38. ],
  39. value: 1
  40. },
  41. {
  42. coords: [
  43. [150.993137, -33.675509],
  44. [126.928257, 37.617069]
  45. ],
  46. value: 1
  47. },
  48. {
  49. coords: [
  50. [55.269441, 25.204514],
  51. [110.094854, 34.525002]
  52. ],
  53. value: 1
  54. },
  55. {
  56. coords: [
  57. [150.993137, -33.675509],
  58. [110.094854, 34.525002]
  59. ],
  60. value: 1
  61. },
  62. {
  63. coords: [
  64. [110.094854, 34.525002],
  65. [106.731711, 48.056936]
  66. ],
  67. value: 1
  68. },
  69. {
  70. coords: [
  71. [126.928257, 37.617069],
  72. [17.108519, 48.179162]
  73. ],
  74. value: 1
  75. },
  76. {
  77. coords: [
  78. [106.731711, 48.056936],
  79. [100.52901, 13.814341]
  80. ],
  81. value: 1
  82. },
  83. {
  84. coords: [
  85. [100.52901, 13.814341],
  86. [150.993137, -33.675509]
  87. ],
  88. value: 1
  89. }
  90. ]
  91. }
  92. ]
  93. }
  94. return options
  95. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/728164
推荐阅读
  

闽ICP备14008679号