当前位置:   article > 正文

echarts树形图的使用_echarts tree datazoom

echarts tree datazoom
  1. <script>
  2. import { projectVehicles } from "../api/api";
  3. export default {
  4. name: "tabvehicle",
  5. data() {
  6. return {
  7. activeNames: ["1"],
  8. vehicleData: [],
  9. TabsData: [],
  10. aaaa: [],
  11. option: [
  12. {
  13. name: "方案场景",
  14. children: [
  15. {
  16. name: "analytics",
  17. },
  18. {
  19. name: "animate",
  20. },
  21. {
  22. name: "data",
  23. },
  24. ],
  25. },
  26. ],
  27. };
  28. },
  29. created() {
  30. // console.log(this.sss[0]);
  31. },
  32. mounted() {
  33. this.showVehicle();
  34. var chartDom = document.getElementById("main");
  35. var myChart = this.$echarts.init(chartDom);
  36. var option;
  37. // myChart.setOption(this.option);
  38. // myChart.showLoading();
  39. // console.log(this.option);
  40. myChart.setOption(
  41. (option = {
  42. tooltip: {
  43. trigger: "item",
  44. triggerOn: "mousemove",
  45. },
  46. series: [
  47. {
  48. type: "tree",
  49. data: [this.option[0]],
  50. top: "0%",
  51. bottom: "14%", //距离
  52. layout: "radial", //分布的方式
  53. symbol: "circle", //点的形状
  54. symbolSize: 40, //圆点的大小
  55. initialTreeDepth: 1, //默认展开多少层
  56. animationDurationUpdate: 750, //展开动画的时常
  57. emphasis: {
  58. focus: "descendant",
  59. },
  60. subtextStyle:{
  61. align:"left",
  62. }
  63. },
  64. ],
  65. })
  66. );
  67. option && myChart.setOption(option);
  68. },

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

闽ICP备14008679号