| 发表于:2007-07-03 11:23:22 楼主 |
public class barchardemo { public static void main(string[] args) throws ioexception { categorydataset dataset= getdataset(); jfreechart chart=chartfactory.createbarchart3d( "水果产量图 ", "水果 ", "产量 ", dataset, plotorientation.vertical, true, false, false); fileoutputstream a=null; try{ a=new fileoutputstream( "d:\\projectbudget\\css\\log.jpg "); chartutilities.writechartasjpeg(a,100,chart,400,300,null); }finally{ try{ a.close(); }catch(exception e){} } } private static categorydataset getdataset(){ defaultcategorydataset dataset= new defaultcategorydataset(); dataset.addvalue(100,null, "苹果 "); dataset.addvalue(200,null, "梨子 "); dataset.addvalue(300,null, "香蕉 "); dataset.addvalue(400,null, "葡萄 "); dataset.addvalue(500,null, "桃子 "); return dataset; } } 这是程序,报错是: null 'key ' argument 请问大家,哪里有错啊 多谢 |
|
|
|
|