- 论坛徽章:
- 0
|
dataset.setValue("苹果",100);
dataset.setValue("梨子",200);
dataset.setValue("葡萄",300);
dataset.setValue("香蕉",400);
dataset.setValue("荔枝",500);
JFreeChart pie_chart = ChartFactory.createPie3DChart("水果产量图",
dataset,
true,
false,
false
);
String pie_filename = ServletUtilities.saveChartAsPNG(pie_chart, 500, 300, null, session);
String pie_graphURL = request.getContextPath() + "/servlet/DisplayChart?filename=" + pie_filename;
%>
" width=500 height=300 border=0 usemap="#">
TimeSeries king = new TimeSeries("东软");
for (int i = 1999; i
// 时间曲线数据集合
TimeSeriesCollection line_dataset = new TimeSeriesCollection();
line_dataset.addSeries(ca);
line_dataset.addSeries(ibm);
line_dataset.addSeries(king);
// dataset.addSeries(jpy);
// dataset.addSeries(mav);
// 时间曲线元素
JFreeChart line_chart =
ChartFactory.createTimeSeriesChart(
title,
domain,
range,
line_dataset,
true,
true,
false);
TextTitle subtitle = new TextTitle(subtitleStr, new Font("黑体", Font.BOLD, 12));
line_chart.addSubtitle(subtitle);
line_chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));
String line_filename = ServletUtilities.saveChartAsPNG(line_chart, 500, 300, null, session);
String line_graphURL = request.getContextPath() + "/servlet/DisplayChart?filename=" + line_filename;
%>
" width=500 height=300 border=0 usemap="#">
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/925/showart_190776.html |
|