public class MySpriderWebPlotTest {
public static void main(String args[]) {
JFrame jf = new JFrame();
jf.add(erstelleSpinnenDiagramm());
jf.pack();
jf.setVisible(true);
}
public static JPanel erstelleSpinnenDiagramm() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
String group1 = "apple ";
dataset.addValue(5, group1, "w1");
dataset.addValue(5, group1, "w2");
dataset.addValue(5, group1, "w3");
dataset.addValue(4, group1, "w4");
dataset.addValue(5, group1, "w5");
dataset.addValue(5, group1, "w6");
dataset.addValue(5, group1, "w7");
dataset.addValue(5, group1, "w8");
SpiderWebPlot spiderwebplot = new SpiderWebPlot(dataset);
JFreeChart jfreechart = new JFreeChart("Test", TextTitle.DEFAULT_FONT,spiderwebplot, false);
LegendTitle legendtitle = new LegendTitle(spiderwebplot);
legendtitle.setPosition(RectangleEdge.BOTTOM);
jfreechart.addSubtitle(legendtitle);
ChartPanel chartpanel = new ChartPanel(jfreechart);
return chartpanel;
}
}
用这种方法生成的图片不能展示在JSP页面上,求高手指点怎样能使雷达图展示在JSP页面上
相关分类