本帖最后由 18979425409 于 2023-5-22 15:21 编辑  
 
在ThingJS低代码平台中,可以通过以下步骤实现森图表的创建、隐藏功能:  
1.创建森图表 代码示例如下: - var forestChart;  //森图表对象 
 
 - // 在线开发引入森大屏图表脚本
 
 -         THING.Utils.dynamicLoad([
 
 -              'https://www.thingjs.com/static/plugins/compile.js',
 
 -             'https://www.thingjs.com/static/plugins/vue.min.js',
 
 -             'https://charts.thingjs.com/s-static/component/9d3b344197244a05b49644a8a6a9bd36.js'
 
 -         ],
 
 -             function () {
 
 -                 /**
 
 -                  * 园区或地图初始化完成后加载图表
 
 -                  */
 
 -                 createButton();
 
 -                 forestChart= new window.conch['C9d3b344197244a05b49644a8a6a9bd36'](document.querySelector('#chartDom'), {
 
 -                     prefix: 'https://charts.thingjs.com/s-static/'
 
 -                 })
 
 -                 forestChart.render();
 
 -             })
 
 -         /**
 
 -          * 利用模板字符串 创建页面元素并添加到div2d中
 
 -          */
 
 -         function createButton() {
 
 -             // 使用 bootstrap 样式
 
 -             var template =
 
 -                 `<div id='chartDom' style='position:absolute;left:20px;top:20px;z-index:2;width:500px;height:380px;'></div>`;
 
 -             var btn = $('#div2d').append($(template));
 
 -             return btn;
 
 -         }
 
  复制代码 
2.隐藏森图表 要隐藏一个森图表,可以使用thingjs提供的hide()方法。例如,要隐藏名为forestChart的图表,代码示例如下:  
 
 |