博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在OAF页面中集成ECharts以及highcharts用于显示图表
阅读量:6908 次
发布时间:2019-06-27

本文共 4312 字,大约阅读时间需要 14 分钟。

历史博文中有讲解在请求中输出基础图表的方式,见地址:

本文讲述在OAF中集成这两类图表。

集成的基本思路:在OAF页面中加入一个rawText组件,在rawText中加入html代码即可,如此简单。

步骤一:官网下载echarts,highcharts相应的js,放入OA_HTML路径(本例在OA_HTML中加入了文件夹cux)。

步骤二:写OAF页面及CO。

ECharts示例

EChartsPG

对应的CO(本代码中只给出了静态数据示例):

package cux.oracle.apps.cux.test.webui;import oracle.apps.fnd.common.VersionInfo;import oracle.apps.fnd.framework.webui.OAControllerImpl;import oracle.apps.fnd.framework.webui.OAPageContext;import oracle.apps.fnd.framework.webui.beans.OARawTextBean;import oracle.apps.fnd.framework.webui.beans.OAWebBean;/** * Controller for ... */public class TestPGCO extends OAControllerImpl{  public static final String RCS_ID="$Header$";  public static final boolean RCS_ID_RECORDED =        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");  /**   * Layout and page setup logic for a region.   * @param pageContext the current OA page context   * @param webBean the web bean corresponding to the region   */  public void processRequest(OAPageContext pageContext, OAWebBean webBean)  {    super.processRequest(pageContext, webBean);//      pageContext.removeJavaScriptLibrary("echarts");      if(pageContext.getJavaScriptLibrary("echarts")==null){          pageContext.putJavaScriptLibrary("echarts","cuxjs/echarts.min.js");               }            OARawTextBean rawTextBean =           (OARawTextBean)webBean.findChildRecursive("EchartsRowText");      if (rawTextBean != null) {          String rawTextMessage = null;          rawTextMessage = "\n" +           "\n" +           "    
\n" + "
\n" + " \n" + "\n" + ""; rawTextBean.setText(rawTextMessage); } } /** * Procedure to handle form submissions for form elements in * a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); }}

效果如下:

 

 

HCharts示例:

对应的CO(本代码中只给出了静态数据示例):

package cux.oracle.apps.cux.test.webui;import oracle.apps.fnd.common.VersionInfo;import oracle.apps.fnd.framework.webui.OAControllerImpl;import oracle.apps.fnd.framework.webui.OAPageContext;import oracle.apps.fnd.framework.webui.beans.OARawTextBean;import oracle.apps.fnd.framework.webui.beans.OAWebBean;/** * Controller for ... */public class TestHChartsPGCO extends OAControllerImpl{  public static final String RCS_ID="$Header$";  public static final boolean RCS_ID_RECORDED =        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");  /**   * Layout and page setup logic for a region.   * @param pageContext the current OA page context   * @param webBean the web bean corresponding to the region   */  public void processRequest(OAPageContext pageContext, OAWebBean webBean)  {    super.processRequest(pageContext, webBean);//      pageContext.removeJavaScriptLibrary("hcharts");      if(pageContext.getJavaScriptLibrary("hcharts")==null){          pageContext.putJavaScriptLibrary("hcharts","cuxjs/highcharts.js");       };                  OARawTextBean rawTextBean =           (OARawTextBean)webBean.findChildRecursive("HChartsRowText");      if (rawTextBean != null) {          String rawTextMessage = null;          rawTextMessage =    "\n" +                               "\n" +                               "    
\n" + "
\n" + "
\n" + " \n" + "\n" + ""; rawTextBean.setText(rawTextMessage); } } /** * Procedure to handle form submissions for form elements in * a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); }}

显示效果如下:

 

转载地址:http://kbfcl.baihongyu.com/

你可能感兴趣的文章
Android中Broadcast Receiver组件具体解释
查看>>
[转载]SQL Server的聚集索引和非聚集索引
查看>>
SSIS中Sql Task 获取系统变量
查看>>
linux dd命令实用详解
查看>>
android系统权限SET_PREFERRED_APPLICATIONS怎么获取
查看>>
Oracle 统计量NO_INVALIDATE参数配置(上)
查看>>
在ECSHOP后台的订单列表中显示配送方式
查看>>
Android Drawable
查看>>
微软职位内部推荐-Senior SDE
查看>>
Java Bigdecimal使用
查看>>
RabbitMQ三种Exchange模式(fanout,direct,topic)的性能比较
查看>>
[UI]抽屉菜单DrawerLayout分析(三)
查看>>
linux shell基础
查看>>
Android中的Animation 动画开发
查看>>
KVM 基础使用(一)
查看>>
怎么将Emeditor设置成网页查看源代码的默认编译器
查看>>
higncharts 编辑Highcharts.com链接
查看>>
ThinkPHP 模板显示display和assign的用法
查看>>
AfxMessageBox和MessageBox差别
查看>>
OpenCms创建站点过程图解——献给OpenCms的刚開始学习的人们
查看>>