页面树结构
转至元数据结尾
转至元数据起始

提示:本文档的示例代码仅适用于本文档中的示例报表/场景。若实际报表/场景与示例代码无法完全适配(如使用功能不一致,或多个宏代码冲突等),需根据实际需求开发代码。

示例说明

打开透视分析,条件区和表格是紧靠在一起的。使用宏之前的效果:


使用宏之后的效果,表格内容和条件区保持一定距离,并且图形可以和表格并排放置:



设置方法

  1. 在资源定制节点下,创建一张透视分析。
  2. 选中透视分析,右键选择 编辑宏 进入报表宏界面。
  3. 在报表宏界面新建客户端模块,在弹出的新建模块对话框中选择对象为 INSIGHT;事件为 onRender;并把下面宏代码复制到代码区域。 


宏类型

类型

对象

事件

ClientSide

INSIGHT

onRenderTable

宏代码

function main(insight) {
    //改变图形的位置
    insight.elem_graphConfig.parentNode.removeChild(insight.elem_graphConfig);
    insight.elem_graph.parentNode.removeChild(insight.elem_graph);
    insight.elem_grid.parentNode.appendChild(insight.elem_graphConfig);
    insight.elem_grid.parentNode.appendChild(insight.elem_graph);
    //让他们并列显示
    insight.elem_grid.style.float = "left";
    insight.elem_grid.style.display = "inline-block";
    insight.elem_graphConfig.style.display = "inline-block";
    insight.elem_graph.style.display = "inline-block";
    //修改图形和表格之间的间隔
    insight.elem_graph.style.paddingLeft = "50px";
    //修改条件输入框和表格之间的间隔
    insight.elem_cond.style.paddingBottom = "50px";
}
  • 无标签