EOS6.0页面流取出list在jsp得到list及entity下的制定property的值

EOS6.0页面流取出list在jsp得到list及entity下的制定property的值

<%@page pageEncoding="UTF-8"%>
<%@page import="java.io.PrintWriter"%>
<%@page import="com.uniper.itsm.chart.BarChart"%>
<%@page import="org.jfree.chart.plot.PlotOrientation"%>
<%@page import="org.jfree.chart.axis.AxisLocation"%>
<%@page import="commonj.sdo.DataObject"%>
<%@page import="com.eos.web.taglib.util.*" %>

<html>
<head>
<title>展示柱图</title>
</head>
<body>

<%
     BarChart chart = new BarChart();
//获得request数据域
Object root= com.eos.web.taglib.util.XpathUtil.getDataContextRoot("request", pageContext);
// "LIST" 为页面流上的Xpath(DataObject数组,获得list对象
DataObject[] entity=(DataObject[])XpathUtil.getObjectByXpath(root,"LIST");
          

//LIST下有几个entity  
int len  = entity.length;

for (int i =0;i<len;i++){
 String name = (String)entity[i].get("NAME");
 int value = entity[i].getInt("VALUE");
 chart.setValue(value,name, "数量");
}
%>

<%
 String title=(String)request.getAttribute("title");

  
 String filename = chart.generatePieChart(title, session,new PrintWriter(out), 400, 200,PlotOrientation.VERTICAL,AxisLocation.BOTTOM_OR_LEFT);
 String graphURL = request.getContextPath()+ "/DisplayChart?filename=" + filename;

 %>
<body>
<table width="150" height="100%"  >    
    <tr align="center" bgcolor="#F0F8FC">
     <td><img src="<%= graphURL %>" width=400
      height=200 border=0 usemap="#<%=filename%>"></td>
    </tr>
   </table>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值