解决方案 »
- 为什么一直出现 org/aspectj/la错误。jar包也导入了。有急用。望大家帮帮忙!!
- 有关搜索的存储过程调用
- 怎么把jsp页面上的数据导出成文本文件?
- 字符串"叮叮当当\叮叮当当"如何通过"\"分离?
- 两个问题(没有关联)
- java.sql.SQLException: ORA-01722: 无效数字 错误怎样解决
- JSP页面查询的中文问题
- 各位国庆快乐请帮忙,一个小问题求救分可以另外再给:)谢谢了
- 系统提示"Result set type is TYPE_FORWARD_ONLY“ 可是我想知道记录条数
- tomcat部署相同项目问题
- <s:form action="page_pagination?subid=%{subid}&titles=%{titles}" method="post">
- 有关window.open的问题!!求教!
chart=ChartFactory.createBarChart3D(jd.replaceAll("街道"," - ")+title1, row, col, dataset,PlotOrientation.VERTICAL,true,true,false);
CategoryPlot plot = chart.getCategoryPlot();
CategoryAxis domainAxis = plot.getDomainAxis();
//domainAxis.setLabelFont(font);
//domainAxis.setTickLabelFont(font);
domainAxis.setMaximumCategoryLabelWidthRatio(1.9f);// 横轴上的 Lable 是否完整显示
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
plot.setDomainAxis(domainAxis);
plot.setNoDataMessage("无统计数据或统计数据全部为0");
//plot.setNoDataMessageFont(font);
//plot.setNoDataMessagePaint(Color.red);
ValueAxis rangeAxis = plot.getRangeAxis();
// 设置最高的一个 Item 与图片顶端的距离
rangeAxis.setUpperMargin(0.15);
// 设置最低的一个 Item 与图片底端的距离
rangeAxis.setLowerMargin(0.15);
//rangeAxis.setLabelFont(font);
if(!"3".equals(menuid)&&!"2".equals(menuid))
{
rangeAxis.setUpperBound(max+max/10);
}
plot.setRangeAxis(rangeAxis);
BarRenderer renderer = new BarRenderer();
renderer.setBaseSeriesVisibleInLegend(true);
//设置平行柱的之间距离
renderer.setItemMargin(0.1);
renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator());
//显示每个柱的数值
//renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
renderer.setBaseItemLabelsVisible(true);
//renderer.setItemLabelFont(font);
renderer.setItemLabelPaint(Color.RED);
renderer.setMaximumBarWidth(0.2);
renderer.setMinimumBarLength(0.2);
//renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator("{1},{0}", NumberFormat.getInstance()));//创建提示标签
plot.setRenderer(renderer);
plot.setForegroundAlpha(0.65f);
//TextTitle tx=new TextTitle();
//tx.setFont(new Font("黑体",20,18));
//tx.setText(title1);
//chart.setTitle(tx);
//图例
LegendTitle legend = chart.getLegend(0);
legend.setItemFont(new Font("隶属", Font.BOLD,12));
java.io.PrintWriter pw=new java.io.PrintWriter(out);
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());//该工具类上面没有介绍,在鼠标移动到图片时显示提示信息是用Map实现的,这些Map是用该类生成的。
filename = ServletUtilities.saveChartAsPNG(chart, 570, 340, info, session);
Iterator it = info.getEntityCollection().iterator();
int k=0,m=0,n=0;
if("3".equals(menuid))
{
while (it.hasNext())
{
//System.out.println("m="+m);m++;
//给柱子或饼块添加点击事件
Object curEntity = it.next();
//System.out.println(curEntity.getClass());
if (curEntity instanceof CategoryItemEntity)//20根柱子
{
CategoryItemEntity catItem = (CategoryItemEntity) curEntity;
String temp=catItem.getToolTipText();
//(,)=
temp=temp.split("=")[0];
temp=temp.substring(1,temp.length()-2);
String a=temp.split(",")[0];
String b=temp.split(",")[1];
//System.out.println(a+" "+show.split(",")[0]);
if(show.split(",")[0].equals(a))
{
a="4";
}
else if(show.split(",")[1].equals(a))
{
a="ly2_qwss";
}
else
{
a="ly2_bwss";
}
catItem.setURLText("javascript:doSubAndLocate('"+a+"','"+b+"')");
//catItem.setToolTipText(title1+" ");
k++;
//System.out.println(k);
}
else
{
//System.out.println(k+" "+curEntity.getClass());
}
}
}
graphURL = request.getContextPath() + "/servlet/DisplayChart?filename=" + filename;
ChartUtilities.writeImageMap(pw, filename, info, true); //鼠标移入事件
function overlib(obj)
{
//alert(obj)
//alert(event.clientX+20)
x0 = event.clientX+20;
y0 = event.clientY-0;
//alert(obj+" "+x0+" "+y0)
//alert(document.getElementById("aa"))
//alert(tooltip)
var div=document.getElementById("tooltip")
div.innerText=obj;
div.style.visibility='visible'
div.style.left=x0;
div.style.top=y0;
//alert(div.innerHTML)
}
//移除
function nd()
{
var div=document.getElementById("tooltip")
div.style.visibility='hidden'
}
//超链接
function doSubAndLocate(a,b)
{
//alert(a+b)
var str="img.jsp?menuid="+a+"&jd="+b;
str=encodeURI(str);
location.href=str;
}