好像说你这个database.Login转型出错。

解决方案 »

  1.   

    jfreechart demo 在ibm developerworks
      

  2.   

    第一个问题就是2楼说的,类转换类型出错,不知道对程序的运行有没有影响,如果没有,那么可以暂时先放一放,至于jfreechart,首先你必须调通jfreechart,可以在基于weblogic或者tomcat的平台上运行,给一个简单的显示实例:
    页面如下:
    <table border="0" align="center" width="760" cellpadding="0" cellspacing="0">
      <tr>
        <td align="center">
        <img src="./chart?filename=<%chartname%>" width="600" height="400">
        </td>
      </tr>
    </table>
    其中的chartname需要你在程序中压出来
    在java中,这里调用了一个jfreechart中的类
    String chartname = ChartBuilder.buildCurveXYChart("注释1", Vector对象, "注释2", "注释3", 600, 400, session);其中buildCurveXYChart的定义如下private static Font titleFont = new Font("黑体", Font.CENTER_BASELINE, 18);
    private static Font plotFont = new Font("黑体", Font.CENTER_BASELINE, 12);
    private static Font legendFont = new Font("黑体", Font.CENTER_BASELINE, 10);public static String buildCurveXYChart(
           String title, Vector data, String xLbl, String valueLbl,
           int width, int height, HttpSession session) {
    XYDataset dataSet = DatasetFactory.createCurveXYDataset(data, 200);
    JFreeChart chart;
    chart = ChartFactory.createXYLineChart(title, xLbl, valueLbl, dataSet, PlotOrientation.VERTICAL, true, true, false);
    chart.getTitle().setFont(titleFont);
    ((StandardLegend)chart.getLegend()).setItemFont(legendFont);
    chart.getXYPlot().getDomainAxis().setLabelFont(plotFont);
    chart.getXYPlot().getRangeAxis().setLabelFont(plotFont);
    try {
    return ServletUtilities.saveChartAsPNG(chart, width, height, session);
    } catch (Exception e) {
             e.printStackTrace();
    return null;
    }
    }最后把 chartname 压入页面,希望对你有所帮助