`
Virgo_S
  • 浏览: 1150819 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

JfreeChart学习总结 整理中。。。

    博客分类:
  • JAVA
阅读更多
五.开始开发
前面的其实都是废话,呵呵。对JFreeChart的操作其实可以分成6步骤
  1. 引入生成图表所需的Jar包
  2. 创建绘制图表所需要的数据集
  3. 创建JFreeChart的实例
  4. 设置图表的生成格式及文件名
  5. 设置图表的浏览路径
  6. 在HTML中,调用<img>显示图表

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.entity.StandardEntityCollection;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.servlet.ServletUtilities;
import org.jfree.data.category.DefaultCategoryDataset;

 public class ChartServelt extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
   static final long serialVersionUID = 1L;
   
	public ChartServelt() {
		super();
	}   	
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//第二步,创建绘制数据集
		DefaultCategoryDataset dataset = new DefaultCategoryDataset();
		int bookSales=0;
		String[] xAxis= new String[10];
		String[] yAxis= new String[20];	
		xAxis[0] = 999+"";
		for(int i=0;i<xAxis.length;i++){
			xAxis[i]=i+"";
			for(int j=0;j<yAxis.length;j++){
				yAxis[j]=j+"";
				bookSales = 1 +(int)(Math.random()*100);
				dataset.addValue(bookSales, xAxis[0], yAxis[j]);
			}
		}
		//第三步,创建JFreeChart实例
		String chartTile = "Hello,JFreeChart";
		JFreeChart chart = ChartFactory.createLineChart(
				chartTile,					//图表的标题
				"XAxis",					//x轴标题
				"YAxis", 					//y轴标题
				dataset, 					//数据集
				PlotOrientation.VERTICAL, 	//直方图的方向,水平方向和垂直方向
				true, 						//是否有图例
				true, 						//是否有提示
				true);						//是否有连接
		//第四步,图表的格式和文件名
		ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
		String fileName = ServletUtilities.saveChartAsPNG(chart,827, 290, info,request.getSession());
		//第五步,浏览路径
		String graphURL = request.getContextPath()+"/servlet/DisplayChart?filename="+fileName;
		request.getRequestDispatcher("test.jsp?graphURL="+graphURL).forward(request, response);
	}   	  	    
}


记住以上6步骤,无论做什么形状的图表,都是在某一步的扩展。

1) 直接生成图片

public class PieChartPicture {   
public static void main(String[] args)    
{   
 PieDataset dataset = getDataSet();   
 JFreeChart chart = ChartFactory.createPieChart3D(   
    "项目进度分布", // chart title   
    dataset,// data   
    true,// include legend   
    true,   
    false  
   );   
  PiePlot3D  plot=(PiePlot3D)chart.getPlot();   
    // 图片中显示百分比:默认方式   
    //plot.setLabelGenerator(new           StandardPieSectionLabelGenerator(StandardPieToolTipGenerator.DEFAULT_TOOLTIP_FORMAT));   
// 图片中显示百分比:自定义方式,{0} 表示选项, {1} 表示数值, {2} 表示所占比例 ,小数点后两位   
 plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}={1}({2})", NumberFormat.getNumberInstance(), new DecimalFormat("0.00%")));    
// 图例显示百分比:自定义方式, {0} 表示选项, {1} 表示数值, {2} 表示所占比例                   
 plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0}={1}({2})"));    
// 设置背景色为白色    
chart.setBackgroundPaint(Color.white);    
// 指定图片的透明度(0.0-1.0)    
 plot.setForegroundAlpha(1.0f);    
// 指定显示的饼图上圆形(false)还椭圆形(true)    
plot.setCircular(true);    
// 设置图标题的字体    
Font font = new Font(" 黑体",Font.CENTER_BASELINE,20);    
TextTitle title = new TextTitle(" 项目状态分布");    
title.setFont(font);     
chart.setTitle(title);    
FileOutputStream fos_jpg = null;    
try {    
     fos_jpg=new FileOutputStream("D:\\ 项目状态分布.jpg");    
     ChartUtilities.writeChartAsJPEG(fos_jpg,100,chart,640,480,null);    
     fos_jpg.close();    
} catch (Exception e) {    
 }    
}    
private static PieDataset getDataSet() {    
DefaultPieDataset dataset = new DefaultPieDataset();    
dataset.setValue(" 市场前期", new Double(10));    
dataset.setValue(" 立项", new Double(15));    
dataset.setValue(" 计划", new Double(10));    
dataset.setValue(" 需求与设计", new Double(10));    
dataset.setValue(" 执行控制", new Double(35));    
dataset.setValue(" 收尾", new Double(10));    
dataset.setValue(" 运维",new Double(10));    
return dataset;           
}   
}   



2) 采用servlet和struts的action方式输出
采用这种方式输出,不用生成图片。
A .servlet输出

public class PieByServlet extends HttpServlet{    
public void service(ServletRequest req, ServletResponse res)    
throws ServletException, IOException    
{    
   res.setContentType("image/jpeg");    
   PieDataset dataset = getDataSet();    
   JFreeChart chart = ChartFactory.createPieChart3D(    
   " 水果饼图", // chart title    
   dataset,// data    
   true, // include legend    
   true,    
   false );    
   //设置图表属性   
// 输出图片    
 ChartUtilities.writeChartAsJPEG(res.getOutputStream(),100,chart,800,600,null);    
}   

B .struts的action方式输出
只将这条语句加上try catch即可,并返回null。


try{          
ChartUtilities.writeChartAsJPEG(response.getOutputStream(),100,chart,800,600,null);    
 } catch (Exception e) {    
}   
return null;   

try{       
ChartUtilities.writeChartAsJPEG(response.getOutputStream(),100,chart,800,600,null); 
 } catch (Exception e) { 
}
return null; 


其实采用这两种方式与生成图片的方式改动并不大
加上语句response.setContentType("image/jpeg");
ChartUtilities.writeChartAsJPEG(new FileOutputStream("D:\\ 项目状态分布.jpg");,100,chart,640,480,null);
文件流改成response的输出流就可以了
hartUtilities.writeChartAsJPEG(response.getOutputStream(),100,chart,800,600,null);

3)jsp+servlet+javabean方式
1. Create ChartViewer servlet

public class ChartViewer extends HttpServlet {    
public void init() throws ServletException {   
}    
//Process the HTTP Get request   
public void doGet(HttpServletRequest request, HttpServletResponse response)  throws ServletException, IOException {    
// get the chart from session   
HttpSession session = request.getSession();    
BufferedImage chartImage = (BufferedImage) session.getAttribute("chartImage");    
// set the content type so the browser can see this as a picture    
response.setContentType("image/png");    
// send the picture    
PngEncoder encoder = new PngEncoder(chartImage, false, 0, 9);    
response.getOutputStream().write(encoder.pngEncode());   
}    
//Process the HTTP Post request    
public void doPost(HttpServletRequest request, HttpServletResponse response)  throws ServletException, IOException {    
doGet(request, response);    
}    
//Process the HTTP Put request    
public void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {    
}    
//Clean up resources    
public void destroy() { }    
}   

public class ChartViewer extends HttpServlet { 
public void init() throws ServletException {
} 
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response)  throws ServletException, IOException { 
// get the chart from session
HttpSession session = request.getSession(); 
BufferedImage chartImage = (BufferedImage) session.getAttribute("chartImage"); 
// set the content type so the browser can see this as a picture 
response.setContentType("image/png"); 
// send the picture 
PngEncoder encoder = new PngEncoder(chartImage, false, 0, 9); 
response.getOutputStream().write(encoder.pngEncode());
} 
//Process the HTTP Post request 
public void doPost(HttpServletRequest request, HttpServletResponse response)  throws ServletException, IOException { 
doGet(request, response); 
} 
//Process the HTTP Put request 
public void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 
} 
//Clean up resources 
public void destroy() { } 
} 


2. Create a servlet map in web.xml


<?xml version="1.0" encoding="UTF-8"?>    
<web-app>    
 <servlet>    
 <servlet-name>ChartViewer</servlet-name>    
 <servlet-class>myapp.webwork.servlets.ChartViewer</servlet-class>    
</servlet>    
<servlet-mapping>    
<servlet-name>ChartViewer</servlet-name>    
<url-pattern>/servlet/ChartViewer</url-pattern>    
</servlet-mapping>    
</web-app>   

<?xml version="1.0" encoding="UTF-8"?> 
<web-app> 
 <servlet> 
 <servlet-name>ChartViewer</servlet-name> 
 <servlet-class>myapp.webwork.servlets.ChartViewer</servlet-class> 
</servlet> 
<servlet-mapping> 
<servlet-name>ChartViewer</servlet-name> 
<url-pattern>/servlet/ChartViewer</url-pattern> 
</servlet-mapping> 
</web-app> 


3. Create a chart in a java bean (Pie3DDemo.java)



public class Pie3DDemo {    
private DefaultPieDataset getDataset() {    
// categories...    
String[] section = new String[] { "Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec" };    
// data...    
double[] data = new double[section.length];    
 for (int i = 0; i < data.length; i++) {    
     data[i] = 10 + (Math.random() * 10);    
}    
// create the dataset...    
DefaultPieDataset dataset = new DefaultPieDataset();    
for (int i = 0; i < data.length; i++) {    
       dataset.setValue(section[i], data[i]);    
}    
return dataset;    
}    
public String getChartViewer(HttpServletRequest request, HttpServletResponse response) {    
 DefaultPieDataset dataset = getDataset();    
// create the chart...    
 <SPAN class=hilite1>JFreeChart</SPAN> chart = ChartFactory.createPie3DChart(    
  "Pie3D Chart Demo",  // chart title    
  dataset,             // data    
  true,                // include legend    
  true,    
  false    
 );    
// set the background color for the chart...    
chart.setBackgroundPaint(Color.cyan);    
PiePlot plot = (PiePlot) chart.getPlot();    
plot.setNoDataMessage("No data available");    
// set drilldown capability...    
 plot.setURLGenerator(new StandardPieURLGenerator("Bar3DDemo.jsp","section"));    
plot.setLabelGenerator(null);    
// OPTIONAL CUSTOMISATION <SPAN class=hilite3>COM</SPAN>PLETED.    
ChartRenderingInfo info = null;    
HttpSession session = request.getSession();    
try {    
//Create RenderingInfo object    
 response.setContentType("text/html");    
 info = new ChartRenderingInfo(new StandardEntityCollection());    
 BufferedImage chartImage = chart.createBufferedImage(640, 400, info);    
// putting chart as BufferedImage in session,    
// thus making it available for the image reading action Action.    
session.setAttribute("chartImage", chartImage);    
PrintWriter writer = new PrintWriter(response.getWriter());    
ChartUtilities.writeImageMap(writer, "imageMap", info);    
writer.flush();    
} catch (Exception e) { }    
  
String pathInfo = "http://";    
pathInfo += request.getServerName();    
int port = request.getServerPort();    
pathInfo += ":"+String.valueOf(port);    
pathInfo += request.getContextPath();    
String chartViewer = pathInfo + "/servlet/ChartViewer";    
return chartViewer;    
}   

public class Pie3DDemo { 
private DefaultPieDataset getDataset() { 
// categories... 
String[] section = new String[] { "Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec" }; 
// data... 
double[] data = new double[section.length]; 
 for (int i = 0; i < data.length; i++) { 
     data[i] = 10 + (Math.random() * 10); 
} 
// create the dataset... 
DefaultPieDataset dataset = new DefaultPieDataset(); 
for (int i = 0; i < data.length; i++) { 
       dataset.setValue(section[i], data[i]); 
} 
return dataset; 
} 
public String getChartViewer(HttpServletRequest request, HttpServletResponse response) { 
 DefaultPieDataset dataset = getDataset(); 
// create the chart... 
 JFreeChart chart = ChartFactory.createPie3DChart( 
  "Pie3D Chart Demo",  // chart title 
  dataset,             // data 
  true,                // include legend 
  true, 
  false 
 ); 
// set the background color for the chart... 
chart.setBackgroundPaint(Color.cyan); 
PiePlot plot = (PiePlot) chart.getPlot(); 
plot.setNoDataMessage("No data available"); 
// set drilldown capability... 
 plot.setURLGenerator(new StandardPieURLGenerator("Bar3DDemo.jsp","section")); 
plot.setLabelGenerator(null); 
// OPTIONAL CUSTOMISATION COMPLETED. 
ChartRenderingInfo info = null; 
HttpSession session = request.getSession(); 
try { 
//Create RenderingInfo object 
 response.setContentType("text/html"); 
 info = new ChartRenderingInfo(new StandardEntityCollection()); 
 BufferedImage chartImage = chart.createBufferedImage(640, 400, info); 
// putting chart as BufferedImage in session, 
// thus making it available for the image reading action Action. 
session.setAttribute("chartImage", chartImage); 
PrintWriter writer = new PrintWriter(response.getWriter()); 
ChartUtilities.writeImageMap(writer, "imageMap", info); 
writer.flush(); 
} catch (Exception e) { } 

String pathInfo = "http://"; 
pathInfo += request.getServerName(); 
int port = request.getServerPort(); 
pathInfo += ":"+String.valueOf(port); 
pathInfo += request.getContextPath(); 
String chartViewer = pathInfo + "/servlet/ChartViewer"; 
return chartViewer; 
} 


6. 页面


   
<html>    
<head>    
<title>Pie Chart Demo</title>    
</head>    
<jsp:useBeanid="myChart"scope="session"class="myapp.webwork.beans.Pie3DDemo" />    
<body>    
<h2>Pie Chart Demo</h2>    
<%String chartViewer = myChart.getChartViewer(request, response);%>    
<img src="<%=chartViewer%>" border=0 usemap="#imageMap">    
</body>    
</html>   

 
<html> 
<head> 
<title>Pie Chart Demo</title> 
</head> 
<jsp:useBeanid="myChart"scope="session"class="myapp.webwork.beans.Pie3DDemo" /> 
<body> 
<h2>Pie Chart Demo</h2> 
<%String chartViewer = myChart.getChartViewer(request, response);%> 
<img src="<%=chartViewer%>" border=0 usemap="#imageMap"> 
</body> 
</html> 


4)采用工具类ChartUtil和DisplayChart(jfreechart的servlet)输出
我用了上面的几个方法输出图片,发现页面里只能输出一个图片,
不过下面的方法可以输出多个图片,而且是几种方式中最简单的一个,推荐使用。

这种方式和上面的三种比较类似,是将javabean里的生成图片的方法写的一个工具类ChartUtil里面。

1 .添加工具类ChartUtil
public class ChartUtil {
// 产生时间序列图,返回图片名称


public  static String generatePieChart(DefaultPieDataset dataset,String title,int width,int height,HttpSession session, PrintWriter pw) {    
  
String filename = null;    
 try {    
 if (session != null)    
 {    
ChartDeleter deleter = (ChartDeleter)session.getAttribute("<SPAN class=hilite1>JFreeChart</SPAN>_Deleter");    
 session.removeAttribute("<SPAN class=hilite1>JFreeChart</SPAN>_Deleter");    
 session.setAttribute("<SPAN class=hilite1>JFreeChart</SPAN>_Deleter", deleter);    
}    
<SPAN class=hilite1>JFreeChart</SPAN> chart = ChartFactory.createPieChart3D(    
title,  // chart title    
dataset, // data    
true,  // include legend    
true,    
false );    
//  Write the chart image to the temporary directory    
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());    
//If the last parameter is null, the chart is a "one time"-chart and will be deleted after the first serving.    
//If the last parameter is a session object, the chart remains until session time out.    
filename = ServletUtilities.saveChartAsPNG(chart, width, height, info, session);    
//  Write the image map to the PrintWriter    
 ChartUtilities.writeImageMap(pw, filename, info,true);    
 pw.flush();    
} catch (Exception e) {    
 System.out.println("Exception - " + e.toString());    
 e.printStackTrace(System.out);    
 filename = "picture_error.png"; }    
return filename;    
}    
}   

public  static String generatePieChart(DefaultPieDataset dataset,String title,int width,int height,HttpSession session, PrintWriter pw) { 

String filename = null; 
 try { 
 if (session != null) 
 { 
ChartDeleter deleter = (ChartDeleter)session.getAttribute("JFreeChart_Deleter"); 
 session.removeAttribute("JFreeChart_Deleter"); 
 session.setAttribute("JFreeChart_Deleter", deleter); 
} 
JFreeChart chart = ChartFactory.createPieChart3D( 
title,  // chart title 
dataset, // data 
true,  // include legend 
true, 
false ); 
//  Write the chart image to the temporary directory 
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection()); 
//If the last parameter is null, the chart is a "one time"-chart and will be deleted after the first serving. 
//If the last parameter is a session object, the chart remains until session time out. 
filename = ServletUtilities.saveChartAsPNG(chart, width, height, info, session); 
//  Write the image map to the PrintWriter 
 ChartUtilities.writeImageMap(pw, filename, info,true); 
 pw.flush(); 
} catch (Exception e) { 
 System.out.println("Exception - " + e.toString()); 
 e.printStackTrace(System.out); 
 filename = "picture_error.png"; } 
return filename; 
} 
} 



2、在action里统计数据,设置好数据集dataset。传到页面

3、 在页面里取出
DefaultPieDataset piedataset=(DefaultPieDataset)request.getAttribute("piedataset");
// 用ChartUtil工具类产生图片
Java代码
String p = ChartUtil.generatePieChart(piedataset," 项目收支线图",500,300,null, new PrintWriter(out));   
String p1 = request.getContextPath() + "/servlet/DisplayChart?filename=" + p;  

String p = ChartUtil.generatePieChart(piedataset," 项目收支线图",500,300,null, new PrintWriter(out));
String p1 = request.getContextPath() + "/servlet/DisplayChart?filename=" + p;
通过以下方式输出

<td><img src="<%= p1 %>" width=500 height=300 border=0 usemap="#<%= p %>"></td>  

<td><img src="<%= p1 %>" width=500 height=300 border=0 usemap="#<%= p %>"></td>

4、在web.xml中添加

<servlet>   
  <servlet-name>DisplayChart</servlet-name>   
  <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>   
</servlet>   
<servlet-mapping>   
    <servlet-name>DisplayChart</servlet-name>   
    <url-pattern>/servlet/DisplayChart</url-pattern>   
</servlet-mapping>  

<servlet>
  <servlet-name>DisplayChart</servlet-name>
  <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>DisplayChart</servlet-name>
    <url-pattern>/servlet/DisplayChart</url-pattern>
</servlet-mapping>


5) ApplicationFrame 方式

public class PieChartDemo1 extends ApplicationFrame {    
public PieChartDemo1(String title) {    
super(title);    
setContentPane(createDemoPanel());    
}    
private static <SPAN class=hilite1>JFreeChart</SPAN> createChart(PieDataset dataset) {    
<SPAN class=hilite1>JFreeChart</SPAN> chart = ChartFactory.createPieChart(    
.......   
return chart;    
}    
  
public static JPanel createDemoPanel() {    
<SPAN class=hilite1>JFreeChart</SPAN> chart = createChart(createDataset());    
return new ChartPanel(chart);    
}    
  
public static void main(String[] args) {    
PieChartDemo1 demo = new PieChartDemo1("Pie Chart Demo 1");    
demo.pack();    
RefineryUtilities.centerFrameOnScreen(demo);    
demo.setVisible(true);    
}    
}   

public class PieChartDemo1 extends ApplicationFrame { 
public PieChartDemo1(String title) { 
super(title); 
setContentPane(createDemoPanel()); 
} 
private static JFreeChart createChart(PieDataset dataset) { 
JFreeChart chart = ChartFactory.createPieChart( 
.......
return chart; 
} 

public static JPanel createDemoPanel() { 
JFreeChart chart = createChart(createDataset()); 
return new ChartPanel(chart); 
} 

public static void main(String[] args) { 
PieChartDemo1 demo = new PieChartDemo1("Pie Chart Demo 1"); 
demo.pack(); 
RefineryUtilities.centerFrameOnScreen(demo); 
demo.setVisible(true); 
} 
} 


六. 可参考资料与网址

官方网站

http://www.jfree.org/jfreechart/index.html

官方论坛

http://www.jfree.org/phpBB2/index.php

API 文档

http://www.jfree.org/jfreechart/api/gjdoc/index.html

中文API

http://blog.sina.com.cn/u/405da78d010000ap

分享到:
评论

相关推荐

    JfreeChart学习总结JfreeChart学习总结

    JfreeChart学习总结JfreeChart学习总结

    jFreeChart学习总结

    ### JFreeChart学习总结 #### 一、为什么学习JFreeChart? 随着互联网技术的飞速发展,越来越多的应用程序转向了Web平台。这不仅包括传统的静态网页,也涵盖了那些需要复杂数据展示的应用,如报表系统。然而,从...

    jfreechart中文学习文档

    总结而言,JFreeChart 不仅是一个功能强大的图表生成库,而且拥有活跃的社区支持,提供了详尽的文档和示例代码。无论是初学者还是有经验的开发者,都能够通过本文档快速上手并熟练掌握 JFreeChart 的使用技巧。

    JFreeChart学习资料.doc

    这份学习资料是针对 JFreeChart 的使用进行讲解,主要涵盖了如何在 Web 项目中集成 JFreeChart 以及创建不同类型的图表。 1. **Web 项目集成**: 在一个标准的 Web 项目中,为了展示 JFreeChart 生成的图表,我们...

    JFreeChart学习总结,包括一些基本资料和例子

    总结,JFreeChart是一个功能强大的Java图表库,适用于各种数据可视化需求。通过理解其核心概念,如Chart、Dataset、Plot和Renderer,以及如何创建和定制图表,开发者能够轻松地在Java项目中实现专业级别的数据可视化...

    JFreeChart学习文档

    **JFreeChart学习文档** **一、JFreeChart简介** JFreeChart是一个强大的Java图表库,它能够生成各种类型的高质量图表,包括折线图、柱状图、饼图、散点图、甘特图以及时间序列图表等。这个库广泛应用于数据分析、...

    解决jfreechart中文乱码方案整理.doc

    因此,针对JFreeChart中的中文乱码问题,本文将汇总并整理一系列有效的解决方案。 #### JFreeChart简介 JFreeChart是一款开源Java图表库,它提供了丰富的API来创建高质量的图表。JFreeChart支持多种类型的图表,...

    JfreeChart中文教程+中文API

    **正文** JFreeChart是一款强大的Java图形库...通过学习《JFreeChart中文教程》和查阅中文API,开发者能够熟练掌握JFreeChart的使用,提升数据可视化的技能,从而更好地在项目中呈现数据,增强用户的理解和分析能力。

    JFreeChart学习资料大全

    **正文** JFreeChart是一款强大的Java图表库,它允许开发者创建各种复杂的...利用这个“JFreeChart学习资料大全”,你可以系统地学习和提升这方面的能力,无论是在数据分析、数据展示还是软件开发中,都将大有裨益。

    JFreeChart API 中文文档

    **JFreeChart API 中文文档详解** ...总之,JFreeChart API 中文文档是开发者在使用JFreeChart进行图表开发时不可或缺的参考资料,通过深入学习和实践,可以轻松掌握各种图表的创建和定制,提升数据可视化的专业水平。

    Jfreechart学习笔记3-简单Line图形创建

    在JFreeChart中,线图通常基于`XYDataset`数据集,其中每个数据项由一对X和Y值定义。`XYLine`可能用于封装这些数据点,并提供方法来设置线的样式,如颜色、线条宽度和线型。例如,你可以创建一个`...

    JFreeChart API中文文档

    JFreeChart API中文文档

    jfreechart的一个小总结

    在本文中,我们将深入探讨 JFreeChart 的核心类和它们在创建图表过程中的作用。 1. **JFreeChart 类**: 这是所有图表的基础,它代表了图表对象。你可以通过 JFreeChart 工厂类创建各种类型的图表,例如饼图、柱状...

    Java EE常用开发组件介绍+JfreeChart学习总结

    如果你还在java EE 门口徘徊,常用开发组件介绍&gt;将是你最好的向导;如果你已经入门了,那恭喜你,你将更容易从全局上把握自己的学习方向...

    如何在eclipse中配置JFreeChart

    JFreeChart是一款功能强大的Java图表库,它能够生成多种图表,如柱状图、折线图、饼图、时间序列图等,常用于Java应用程序中。而Eclipse是一个开源的集成开发环境,广泛用于Java语言的开发。在Eclipse中配置...

Global site tag (gtag.js) - Google Analytics