<P:lineChart>展示的问题

本文介绍了使用PrimeFaces中的&lt;p:lineChart&gt;组件时遇到的问题:图表被其他导航元素遮挡。尝试了多种解决方案如调整z-index值和使用rgba颜色均无效,最终通过设置wmode属性为transparent成功解决了图表显示被遮挡的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用primefaces里面的<p:lineChart> 在展示的时候,不能被其他的导航树遮盖。

用了rbga也没有起效果,自定义styleClass zindex=-1也不起效果。

最后用wmode="transparent"得到了处理。
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%> <%@page import="util.Info"%> <%@page import="dao.CommDAO"%> <%@page import="util.PageManager"%> <html> <head> <title>收入</title> <LINK href="css.css" type=text/css rel=stylesheet> <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script> <LINK href="images/style2.css" type=text/css rel=stylesheet> <script type="text/javascript" src="js/popup.js"></script> <style type="text/css"> #button1 { width: 80px; height: 35px; background-color: 008AFF; font-family: '微软雅黑', sans-serif; font-size: 15px; color: #ffffff; border: solid 0px #EDCE0F; border-radius: 3px; } input[type="text"],#btn1,#btn2 { box-sizing: border-box; text-align: left; font-size: 1.1em; color: #777777; height: 40px; border: 1px solid E3E2E5; width: 350px; border-radius: 3px; padding: 3px 15px 1px 15px;/*设置input内边距*/ } </style> </head> <body> <p> <br> <% Calendar calendar = Calendar.getInstance(); int month = calendar.get(Calendar.MONTH) + 1; int year = calendar.get(Calendar.YEAR); String y = request.getParameter("year"); String m = request.getParameter("month"); if(y!=null&&!"".equals(y)){ year = Integer.parseInt(y); month = Integer.parseInt(m); } String par = ""; if(month<10){ par = year + "-0" + month; }else{ par = year + "-" + month; } String yonghu = ""; String leixing = ""; String jine = ""; String username = ""; if(!"".equals(request.getParameter("username"))&&request.getParameter("username")!=null){ username = request.getParameter("username"); } String sql = "select * from shouru where yonghu='" + username + "' and riqi like '%" + par + "%' "; double ze = 0; double se = 0; double ne = 0; double xe = 0; double yt = 0; double zz = 0; for (HashMap map : new CommDAO().select(sql)) { leixing = (String) map.get("leixing"); jine = (String) map.get("jine"); yonghu = (String) map.get("yonghu"); if (map.get("leixing").equals("工资")) { ze = ze + Float.valueOf(jine).floatValue(); } if (map.get("leixing").equals("理财收入")) { se = se + Float.valueOf(jine).floatValue(); } if (map.get("leixing").equals("其他收入")) { ne = ne + Float.valueOf(jine).floatValue(); } zz = ze + se + ne + xe; } %> </p> <form action="srtt2.jsp?f=f" method="post" name="form1" > <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td> <select name="year" style="height: 40px;width: 200px;border: 1px solid E3E2E5;font-size: 18px;"> <% int yy = calendar.get(Calendar.YEAR); for(int i=yy-10;i<=yy;i++){ %> <option value="<%=i %>" <%if(i==year){%> selected <%} %>><%=i %>年</option> <% } %> </select> <select name="month" style="height: 40px;width: 200px;border: 1px solid E3E2E5;font-size: 18px;"> <% for(int i=1;i<=12;i++){ %> <option value="<%=i %>" <%if(i==month){%> selected <%} %>><%=i %>月</option> <% } %> </select> <select name="username" style="height: 40px;width: 200px;border: 1px solid E3E2E5;font-size: 18px;"> <option value="">请选择</option> <% String url = ""; String sql3 = "select * from yonghuzhuce where 1=1 "; ArrayList<HashMap> list = PageManager.getPages(url, 100, sql3, request); for (HashMap map : list) { %> <option value="<%=map.get("yonghuming") %>" <% if(username.equals(map.get("yonghuming"))){%>selected<%} %> ><%=map.get("xingming") %></option> <% } %> </select> <input type="submit" name="Submit" id="button1" value="查询" id="button2" /> </td> </tr> </table> <br> <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td width="40%" bgcolor='#E1F2F4' align="center"> <div align="center" class="STYLE1"> <%=year %>年<%=month %>月 </div> </td> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">金额</font> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 工资收入 </font> </td> <td align="center"> <div align="center"><%=ze%>元 </div> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 理财收入 </font> </td> <td> <div align="center"><%=se%>元 </div> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 其他收入 </font> </td> <td> <div align="center"><%=ne%>元 </div> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"> 合计 </font> </td> <td> <div align="center"><%=zz%>元 </div> </td> </tr> </table> <br><br> <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td width="12%" bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'"><%=year %>年<%=month %>月</font> </td> <td width="88%" bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">金额</font> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">工资收入</font> </td> <td><%=ze%>元 <table width="<%=(ze / zz * 1050)%>" border="1" bgcolor="#CCCC33"> <tr> <td>   </td> </tr> </table> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">理财收入</font> </td> <td><%=se%>元 <table width="<%=(se / zz * 1050)%>" border="1" bgcolor="#000000"> <tr> <td>   </td> </tr> </table> </td> </tr> <tr> <td bgcolor='#E1F2F4' align="center"> <font style="font-family:'微软雅黑'">其他收入</font> </td> <td><%=ne%>元 <table width="<%=(ne / zz * 1050)%>" border="1" bgcolor="#339900"> <tr> <td>   </td> </tr> </table> </td> </tr> </table> </form> <br> <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="newsline" bgColor="#ffffff"> <tr> <td> <font color="red" style="font-family:'微软雅黑'">理财建议:</font> <% if(zz>0&&zz<5000){ %> <font color="red" style="font-family:'微软雅黑'">整体收入不高,注意将支出重点放在日常生活上。</font> <% }else if(5000<=zz&&zz<10000){ %> <font color="red" style="font-family:'微软雅黑'">整体收入可观,可进行一些风险较低的理财基金,市面上涌现大量的基金可供选择,请谨慎挑选。</font> <% }else if(zz>=10000){ %> <font color="red" style="font-family:'微软雅黑'">收入可观,建议可入手几只中高风险的基金或关注股票行情。温馨提醒:股市有风险,投资须谨慎。</font> <% } %> </td> </tr> </table> </body> </html> 加入折线图
05-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值