【问题标题】:How to use apex-d3-organization-chart plugin如何使用 apex-d3-organization-chart 插件
【发布时间】:2021-04-11 03:51:30
【问题描述】:

我想用 apex-d3-organization-chart 插件创建一个组织结构图。 我添加了这个插件,然后我创建了一个页面并插入了一个区域并将其更改为这个插件。 在那个区域的源码部分已经写了这段代码:

SELECT
       /* positive number id of the element (should start with 1 or higher) */
       ROWNUM                          AS ID,
       /* positive number id of the parent (top parent should be 0) */
       CASE
         WHEN ROWNUM <= 1 THEN 0
         WHEN ROWNUM <= 4 THEN 1
         ELSE ROUND(ROWNUM / 4)
       END                             AS PARENT_ID,
       /* name of the item */
       'Item '
       || ROWNUM                       AS NAME,
       /* tooltip for the item */
       'This is item '
       || ROWNUM                       AS TOOLTIP,
       /* link of the item (is only used when is leaf) */
       'https://github.com/RonnyWeiss' AS LINK,
       /* color of the item */
       DECODE(ROWNUM, 1, 'rgba(192,0,15,1)', NULL) AS COLOR
FROM   DUAL
CONNECT BY ROWNUM <= 30 

现在我想改变它并使用我的桌子。 我该怎么做?

【问题讨论】:

    标签: oracle charts oracle-apex


    【解决方案1】:

    首先在 SQL 命令中复制该查询并运行它。现在您可以看到一个包含一些字段的表格。现在编写一个选择查询,其字段与源查询完全相同。 类似的东西:

        SELECT 
        ID,
        PARENT_ID,
        TITLE as NAME,
        CASE WHEN 
        PARENT_ID=0 THEN 'rgba(192,0,15,1)'
        ELSE 'rgba(0,0,250,1)'
        END as COLOR
        FROM TLX_USER_ROLE
        ORDER BY PARENT_ID asc 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-16
      • 2018-10-23
      • 2017-12-15
      • 2018-09-19
      • 1970-01-01
      • 2020-10-28
      • 2022-08-02
      • 2019-05-04
      相关资源
      最近更新 更多