你可以用google查到一些jfreechart例子

解决方案 »

  1.   

    就用jfreechart!好象前几天还有人问过这个问题,问用什么来做图表好,
    有人给了很多例子的!
    http://community.csdn.net/Expert/topic/3564/3564753.xml?temp=2.869815E-02
    你去看一看吧 
    也许对你有帮助
      

  2.   

    在《JSP编程指南》最后有几章专门讲这种2进制的编程的
      

  3.   

    自己绘制:)其实也不难,好好看看graphics类就没有问题的,用servlet绘制,jsp显示
      

  4.   

    楼上的,不知道你是否熟悉VML,如果熟悉这个,应该很好解决,建议你找一下VML方面的资料,再配合javascript我想应该能实现你的问题!
      

  5.   

    这个画曲线包括坐标,你参考一下!Servelet./*
     * Created on 2004-9-1
     *
     */
    package com.beltino.communitymedical.appservlet.hbp;import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.beltino.util.*;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import com.beltino.communitymedical.hbp.*;/**
     * @author aus
     *  
     */
    public class HBPJpegAction extends HttpServlet {
        private ServletOutputStream out = null;
        private BufferedImage image = null;
        private Graphics graphics = null;
        private JPEGImageEncoder encoder = null;
        private int xwidth = 700;
        private int yheight = 300;
        private int scoreXY = 25;
        private String startDate = ""; //开始时间
        private String endDate = ""; //结束时间
        private String cardNum = "";
        private HBPCalendar hb = new HBPCalendar();
        private java.util.ArrayList showList = new java.util.ArrayList();
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            request.setCharacterEncoding("gbk");
            response.setContentType("text/html;charset=gbk");
            response.setContentType("image/jpeg");
            startDate = ParamUtil.getParameterSqlDate(request, "startDate").toString();
            endDate = ParamUtil.getParameterSqlDate(request, "endDate").toString();
            cardNum = ParamUtil.getParameter(request, "cardNum");
            out = response.getOutputStream();
            image = new BufferedImage(xwidth, yheight, BufferedImage.TYPE_INT_RGB);
            doAction();
        }
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            doGet(request, response);
        }
        void doAction() throws ServletException, IOException {
            graphics = image.getGraphics();
            graphics.setColor(Color.white);
            graphics.drawLine(scoreXY, yheight - scoreXY , xwidth - scoreXY, yheight - scoreXY);  //横坐标
            graphics.drawLine(scoreXY, scoreXY, scoreXY, yheight - scoreXY);                 //纵坐标
            graphics.drawString("血压值", scoreXY - 10, scoreXY - 10);
            graphics.drawString("日期", xwidth - scoreXY-8, yheight-5);
            showList = hb.getArrBlood(cardNum, startDate, endDate);
            doDraw(graphics, showList);
            encoder = JPEGCodec.createJPEGEncoder(out);
            encoder.encode(image);
            graphics.dispose();
            out.close();
        }
        //画坐标
        void doDraw(Graphics g, java.util.ArrayList ret) {
            for (int i = 0; i < ret.size(); i++) {
                g.drawString("|", scoreXY + (i + 1) * 40 + 14, yheight - 26);         
                //写日期
                g.drawString(transTo(((HBPValueBean) ret.get(i)).getMeterageDate()), scoreXY + (i + 1) * 40, yheight - 5);
                //写血压值
                if (i != ret.size()-1) {
                    g.drawLine(scoreXY + (i + 1) * 40+14,yheight-50-Integer.parseInt(((HBPValueBean) ret.get(i)).getMeterageValueLow()), scoreXY + (i + 2) * 40+14, yheight-50-Integer.parseInt(((HBPValueBean) ret.get(i + 1)).getMeterageValueLow()));
                }
                if (i != ret.size()-1) {
                    g.drawLine(scoreXY + (i + 1) * 40+14, yheight-50-Integer.parseInt(((HBPValueBean) ret.get(i)).getMeterageValueHigh()), scoreXY + (i + 2) * 40+14,yheight-50-Integer.parseInt(((HBPValueBean) ret.get(i + 1)).getMeterageValueHigh()));
                }
            
            }
            g.drawString("-",scoreXY,yheight-50-60);       
            g.drawString("60",6,yheight-50-60);   
            g.drawString("-",scoreXY,yheight-50-80);       
            g.drawString("80",6,yheight-50-80);   
            g.drawString("-",scoreXY,yheight-50-90);       
            g.drawString("90",6,yheight-50-90);   
            g.drawString("-",scoreXY,yheight-50-100);       
            g.drawString("100",0,yheight-50-100);   
            g.drawString("-",scoreXY,yheight-50-120);       
            g.drawString("120",0,yheight-50-120);      
            g.drawString("-",scoreXY,yheight-140-50);       
            g.drawString("140",0,yheight-140-50); 
            g.drawString("-",scoreXY,yheight-160-50);       
            g.drawString("160",0,yheight-160-50); 
            g.drawString("-",scoreXY,yheight-180-50);       
            g.drawString("180",0,yheight-180-50);         
            g.drawString("-",scoreXY,50);       
            g.drawString("200",0,50);
        }
        //日期格式转换
        String transTo(String source) {
            java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat("dd/MM");
            String retStr = "";
            try {
                retStr = dateFormat.format(DateUtil.strToSqlDate(source));
            } catch (Exception e) {
                retStr = "";
                e.printStackTrace();
            }
            return retStr;
        }
    }
      

  6.   

    实时性的不太好实现,如果不是就考虑用jfreechart
      

  7.   

    不是实时的.是通过对数据库进行查询,读取数据,然后将各点进行连接....同意大家的看法,使用jfreechart , 我不太会弄, 希望大家能提供一个详细的操作过程......不甚感激......
      

  8.   

    www.jfree.gov
    上面有例子,反编译可以得到原码。很好用的哦
      

  9.   

    弄了一天,有点头绪了...谢谢大家的指点.....是使用jfree这种方法....但有些地方仍然有点疑惑,怎样给曲线图的每个节点,加上注释.....请各位兄弟,再加以指点...
      

  10.   

    jfreechart-demo里面有,慢慢看看
      

  11.   

    用cewolf实现,很简单的,我们做决策时用的图表都是用的它,给份么?
      

  12.   

    jfreechart-demo 里的标注,是触发式的,即当鼠标放到节点上时,显示标注,并非在外部显示的...我不知道使用哪个类的哪个方法来解决这个问题....知道的朋友请指点一二....
      

  13.   

    http://www.jfree.org/jfreechart/images/WaterfallChartDemo.png
    根据这个例子,改改
      

  14.   

    前段时间用jsp+xml+flash做了实时曲线图感觉还可以,只是cpu占用的利害。如果想要我可以发给你。
      

  15.   

    It is reported that, the issue of Procedures of Collective Negotiation for Determining Employee Wages (For Trial Implementation), has greatly promoted the work of collective negotiation for determining employee wages. At present, almost 300 thousand enterprises have concluded collective contract especially for wages through collective negotiation. Further promotion of collective negotiation system for determining employee wages is an important content in the establishment of harmonious labour relationship and construction of a harmonious society. The contents of collective negotiation for determining employee wages could be comprehensive or particularly emphasized. For example, in the enterprises with well-balanced operation and benefit, the point should be stressed at negotiation for wage level, bonus distribution, allowance and welfare to establish regular wage growth system and make all employees share the achievements of enterprise reformation and development. As to the enterprises with difficulties in production operation, the point could be stressed at the negotiation for payment procedure and cost of living for laid-offs to establish a payment security system. As to the enterprises undergoing restructuring, the point should be stressed at straightening out the wage distribution relation and negotiating for internal wage distribution system. However, for this moment, the problem of default and dock on wages should be solved urgently.
      

  16.   

    回复人: kobetong(到处跑,狂跑) ( ) 信誉:100  2004-11-19 18:19:00  得分: 0  
     
     
       前段时间用jsp+xml+flash做了实时曲线图感觉还可以,只是cpu占用的利害。如果想要我可以发给你。
      
     
    ~~~~~~~~~~~~~~~~·
    我也建议用这个!可以做的很精致。