5.案例:查询各个级别分销商的数量(饼图和柱状图)-JSP
来源:互联网 发布:视频软件 编辑:程序博客网 时间:2024/04/30 19:25
<%@ page language="java" pageEncoding="GBK" contentType="text/html; charset=GBK"%><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <title>分销商级别分布图</title><link rel="stylesheet" href="../style/drp.css"><script type="text/javascript">/** * 查询按钮单击事件的响应函数的调用函数 */function query() {// iframe,用来显示饼图或是柱状图 var pageFrame = window.document.getElementById("pageFrame");// radiobutton,选择饼图或是柱状图var radiobuttons = window.document.getElementsByName("radiobutton");// radiobutton的值,选择饼图或是柱状图var radiobuttonValue;// 获取用户的选择,选择饼图或是柱状图for(var i = 0; i < radiobuttons.length; i++) { if (radiobuttons[i].checked) { radiobuttonValue = radiobuttons[i].value; } } // 设置iframe的src,src是servlet,返回的要么是饼图,要么是柱状图if (radiobuttonValue == "pieChart") {pageFrame.src = "${pageContext.request.contextPath}/servlet/CharMemoServlet";} else {pageFrame.src = "${pageContext.request.contextPath}/servlet/BarChartServlet";}}</script> </head> <body class="body1"><form name="clientLevelChartForm" target="_self"id="clientLevelChartForm"><div align="center"><table width="95%" border="0" cellspacing="0" cellpadding="0"height="35"><tr><td class="p1" height="18" nowrap> </td></tr><tr><td width="522" class="p1" height="17" nowrap><img src="../images/mark_arrow_02.gif" width="14" height="14"> <b>统计/报表管理>>分销商级别分布图</b></td></tr></table><hr width="100%" align="center" size=0><table width="95%" height="40" border="0" cellpadding="0"cellspacing="0"><tr><td width="14%" height="40"><div align="right">分销大区: </div></td><td width="13%"><select name="region" class="select1" id="region"><option value="0">--全部--</option><option value="1">华北区</option><option value="2">东北区</option><option value="3">华南区</option></select></td><td width="13%"><div align="right">分销省: </div></td><td width="16%"><select name="province" class="select1" id="province"><option value="0">--全部--</option></select></td><td width="16%"><input name="radiobutton" type="radio" value="pieChart" checked>饼图 <input name="radiobutton" type="radio" value="barChart">柱状图</td> <td width="28%"><input name="btnQuery" type="button" class="button1"id="btnQuery" value="查询" onclick="query()"></td></tr> </table><hr width="100%" align="center" size=0> <div align="center"></div></div><table width="95%" border="0" cellpadding="0"cellspacing="0"> <tr> <td align="center"> <iframe scrolling="auto" name="pageFrame" id="pageFrame" src="${pageContext.request.contextPath}/servlet/CharMemoServlet" frameborder="0" width="500" height="500" ></iframe> </td> </tr> </table><p> </p></form></body> </html>