当前位置: 代码迷 >> Java Web开发 >> 请教: 小弟我用jfreechart做出了柱状图,如何可以在柱体上加上链接呢
  详细解决方案

请教: 小弟我用jfreechart做出了柱状图,如何可以在柱体上加上链接呢

热度:752   发布时间:2016-04-17 13:10:40.0
请问: 我用jfreechart做出了柱状图,怎么可以在柱体上加上链接呢?
我用jfreechart实现了柱状图,怎么可以在柱体上加上链接呢?
就是可以点击柱体转向或弹出新的页面.
可以加的话,又怎么控制它是新开窗口还是在本页打开呢?先谢了..

部分代码:
.......................
JFreeChart   chart   =   ChartFactory.createBarChart3D(
                                      null,
                                      null,
                                      null,
                                    dataset,
                                    PlotOrientation.VERTICAL,
                                    false,false,false);
//设置整个图表背景    
chart.setBackgroundPaint(Color.GREEN);

Font   font=new   Font( "宋体 ",Font.ITALIC,   6);

CategoryPlot   plot   =   chart.getCategoryPlot();

//设置绘图区背景
plot.setBackgroundPaint(Color.ORANGE);
//设置绘图区线条颜色
plot.setRangeGridlinePaint(Color.RED);

CategoryAxis   domainAxis   =   plot.getDomainAxis();
//设置绘图区柱体的左边距
domainAxis.setLowerMargin(0.01);
//设置绘图区柱体的右边距
domainAxis.setUpperMargin(0.01);

domainAxis.setTickLabelFont(new   Font( "宋体 ",Font.ITALIC,   7));

plot.setDomainAxis(domainAxis);

ValueAxis   rangeAxis   =   plot.getRangeAxis();
//设置数值轴的字体
rangeAxis.setTickLabelFont(new   Font( "宋体 ",Font.ITALIC,   8));  
BarRenderer3D   renderer   =   new   BarRenderer3D();
renderer.setBaseOutlinePaint(Color.BLACK);
..................


------解决方案--------------------
好像是用 <map 的一个标记,
JFreeChart可以生成这个文什的