tree-radial.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <html>
  2. <head>
  3. <meta charset="utf-8" />
  4. <meta name="viewport" content="width=device-width, initial-scale=1" />
  5. <script src="lib/esl.js"></script>
  6. <script src="lib/config.js"></script>
  7. <script src="lib/jquery.min.js"></script>
  8. </head>
  9. <body>
  10. <style>
  11. html, body, #main {
  12. width: 100%;
  13. padding: 0;
  14. margin: 0;
  15. height: 100%;
  16. }
  17. </style>
  18. <div id="main"></div>
  19. <script>
  20. require([
  21. 'echarts'
  22. // 'echarts/chart/tree',
  23. // 'echarts/component/tooltip'
  24. ], function (echarts) {
  25. var chart = echarts.init(document.getElementById('main'), null, {
  26. });
  27. window.onresize = function () {
  28. chart.resize();
  29. };
  30. $.getJSON('./data/flare.json')
  31. .done(function (data) {
  32. chart.setOption({
  33. tooltip: {
  34. trigger: 'item',
  35. triggerOn: 'mousemove'
  36. },
  37. series:[
  38. {
  39. type: 'tree',
  40. data: [data],
  41. top: '18%',
  42. bottom: '14%',
  43. layout: 'radial',
  44. symbol: 'emptyCircle',
  45. symbolSize: 7,
  46. initialTreeDepth: 3,
  47. animationDurationUpdate: 750
  48. }
  49. ]
  50. });
  51. });
  52. });
  53. </script>
  54. </body>
  55. </html>