/|\
|--2009-12-27
|
|
|--2009-12-26
|
|........
|
|
|
|
|--2009-10-10
|_________________________________________________________________________
| | | | |
abc.com cde.com def.com efg.com fgh.com 我想Y轴为 日期, X轴为网址,其实就是字符。
JFreechart 能实现吗?
请给点小代码提示一下,感激不尽!
|--2009-12-27
|
|
|--2009-12-26
|
|........
|
|
|
|
|--2009-10-10
|_________________________________________________________________________
| | | | |
abc.com cde.com def.com efg.com fgh.com 我想Y轴为 日期, X轴为网址,其实就是字符。
JFreechart 能实现吗?
请给点小代码提示一下,感激不尽!
解决方案 »
- struts注解小问题。。大家帮忙看一下哈。
- struts2 怎么配置多个类
- 求助!如何使用Criteria对象组合一个判断是否是今天的查询条件?
- hibernate QBE如何实现多表查询
- jsp分页中碰到的sqlserver语句问题?
- 为什么同一个数据库里的表有的可以执行preparestatement,有的取不执行呢?
- 程序将电脑卡死,重启后程序用不了,出现这种问题,求助,在线等。
- struts留言预览,怎么格式化文本??
- 标题:tomcat下部署web服务,session的问题。急,求思路!!
- 请教问题:Mybatis执行select count(*)返回结果为0,但是数据库表中有数据
- 为什么查询结果没有输出?
- huoyingfans被收录了
Map map = getDateMap(sendInfoId, endTimeDetail);
TimeSeries series1 = new TimeSeries(seriesFName);
TimeSeries series2 = new TimeSeries(seriesSName);
Set keys = map.keySet();
for (Object o : keys) {
String time = (String) o;
Date date = Tool.str2Date(time, Tool.DATE_PATTERN);
OpenReport or = reportDao.getOpenReport(sendInfoId, time);
series1.add(new Day(date), or.getOpenCount());
series2.add(new Day(date), or.getIpCount());
}
TimeZone timeZone = TimeZone.getTimeZone("Pacific/Auckland");
TimeSeriesCollection timeSeriesCollection = new TimeSeriesCollection(
timeZone); timeSeriesCollection.addSeries(series1);
timeSeriesCollection.addSeries(series2); XYDataset dataset = timeSeriesCollection; JFreeChart chart = ChartFactory.createTimeSeriesChart(title,
timeAxisLabel, valueAxisLabel, dataset, true, true, false);
//X轴
XYPlot plot = (XYPlot) chart.getPlot();
XYItemRenderer renderer = plot.getRenderer();
StandardXYToolTipGenerator generator = new StandardXYToolTipGenerator(
"{1} = {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0"));
renderer.setToolTipGenerator(generator);//这是把X轴的设为日期类型//Y轴
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
axis.setLowerMargin(0.01);
axis.setUpperMargin(0.01);//你只需要在设置的时候反过来就可以,根据你的需要setXX