代码如下:
for(int k=0;k<bpList.size();k++)
{
baseprice = 0;
Baseprice bp = bpList.get(k);
if(bp.getBaseprice()!=null)
baseprice = bp.getBaseprice();
String basepriceS = df.format(Double.valueOf(baseprice));
priceDateStr = sf.format(bp.getBeginDate());
SimpleDateFormat dfYear = new java.text.SimpleDateFormat("yyyy");
SimpleDateFormat dfMonth = new java.text.SimpleDateFormat("MM");
SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
String ss = sdf.format(bp.getBeginDate());
Date date = sdf.parse(ss);
calendar.setTime(date);
year = Integer.valueOf(dfYear.format(bp.getBeginDate()));
// month = Integer.valueOf(dfMonth.format(bp.getBeginDate()));
int m = calendar.get(Calendar.MONTH)+1;
new Year(year);
new org.jfree.data.time.Year(year);
new org.jfree.data.time.Month(date);
RegularTimePeriod s = new Month(date);
// timeseries.addOrUpdate(new Month(new org.jfree.data.time.Month(date).getMonth(), year), Double.valueOf(basepriceS));
// timeseries.addOrUpdate(s, Double.valueOf(basepriceS));
// timeseries.addOrUpdate(new Month(m,year),Double.valueOf(basepriceS));
用上面三个已 // 屏蔽 的方法显示的是"月和日"
timeseries.addOrUpdate(new Month(2,year),Double.valueOf(basepriceS));用上面这个把月固定为一个数,就显示为正常的年和月.
请问这怎么回事呢,都是int类型的.试过很多种方法都没成功,希望高手帮忙解答一二,
分不多,请笑纳,谢谢.
}