yeyu710(叶雨) 
我现在已把图删了,哈哈,更搞笑,生成新的图了,数据是对的,可是在网页上还是以前的图,好象网页把以前的那个旧图给保存了,我晕

解决方案 »

  1.   

    我LINECHART3D怎么不出数据啊,它的DATESET应该和BARCHART3D一样啊
      

  2.   

    LZ可能是存成图片文件的吧,这样可能有问题。
    我是这样做的:
        //把图片存成流,放在SESSION里
        ChartRenderingInfo info = new ChartRenderingInfo();
        ByteArrayOutputStream baosChart = new ByteArrayOutputStream();
        ChartUtilities.writeChartAsPNG(baosChart,chart,540,300,info);
        session.setAttribute("chart" + sChartID,baosChart);界面上:
    <img name="chart" src="servlet/displayChart?id=<%=sChartID%>" border="0">
    用专门显示的SERVLET输出。sChartID可以用使用时间等数值,这样基本就不会重了。
      

  3.   

    public class displayChart extends HttpServlet
    {
        public synchronized void service(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException
        {
            //取得图表的ID
            String sChartID = req.getParameter("id");
            if(sChartID == null)
            {
                throw new ServletException("Parameter 'id' is missing!");
            }        //从session中取到已经画好的图表
            HttpSession session = req.getSession();
            ByteArrayOutputStream baosOut =
                (ByteArrayOutputStream)session.getAttribute("chart" + sChartID);        //输出该图表
            byte[] byContent = baosOut.toByteArray();
            ServletOutputStream out = res.getOutputStream();
            out.write(byContent, 0, byContent.length);        //清空session
            session.setAttribute("chart" + sChartID, null);
            return;
        }    public void init(ServletConfig s) throws ServletException
        {
            super.init(s);
        }    public void destroy()
        {
            super.destroy();
        }
    }
      

  4.   

    继承LabelGenerator,重实现LabelGenerator
      

  5.   

    congliu(取次花丛都不顾,半缘修道半缘君。) 
    您能写的再细些吗?这个LabelGenerator是干嘛用的呢?多谢多谢
    knight12(12Knight) 
    您这个方法应该可以,可是改动的太多了,我一个action就1万多行,好多action的,实在没办法改了。
      

  6.   

    那就动态生成图片的名称,比如SESSIONID+时间,这样可以确保每次生成的文件是不重名的,处理完了注意删掉就可以了。
      

  7.   

    问题应该是浏览器cache吧
    在html中加入相应的meta说明
    具体语句问google
      

  8.   

    还是生成不同的文件名,不过在生成前先删除一下,唉,改动好多,就这几行代码要改好几天,哭死
    好几个1万多行的class
      

  9.   

    iDay(鱼头) 
    浏览器的三个报头值为Cache-Control、Pragma、Expires这三个都不好使的,查过,试过,失败了