JFreeChart - An Introduction

JFreeChart is a free open source java chart library. David Gilbert founded the JFreeChart project in February 2000.

JFreeChart - An Introduction

JFreeChart - An Introduction

     

JFreeChart is a free open source java chart library. David Gilbert founded the JFreeChart project in February 2000. Now a days, it is used by around 40000 to 50000 developers. It is used to generate the charts like Area and Line Charts, Pie charts, Bar Charts, Bubble Charts, Gantt Charts. Developers get a better choice to add professional quality charts in swing and web based application by JFreeChart. JFreeChart provides many interactive features like tooltips etc. JFreeChart includes some of the following features as given below.

  • JFreeChart have well documented API, which supports the wide range of charts.
     
  • JFreeChart supports Swing components, vector graphics file format (like PDF, SVG and EPS) and image files (like JPEG and PNG).
     
  • JFreeChart is easy to extend and it can be used for developing client side and server side applications.

JFreeChart requires the JCommon class library.

JCommon ? It is a collection of useful classes that is used by JFreeChart project. The JCommon library has common classes that provide some global utility functionality for non-GUI and GUI applications. Some of the following features are available in JCommon library:

  • a general logging framework 
  • user interface classes for displaying information about applications  
  • configuration and dependency management code
  • text utilities
  • custom layout managers
  • serialization utilities
  • a date chooser panel
  • XML parser support classes

In this section we are providing you some JFreeChart examples that is based on JFreeChart version 1.0.4. For compiling and running these following examples you must have to set two jar file: jfreechart-1.0.4-demo.jar and jcommon-1.0.8.jar, in your classpath.

Download the full source code with required JFreeChart library jar files

Chart and Dataset

In JFreeChart project, you have to create a Dataset for creating a chart . It contains the data, which displays in the chart. JFreeChart have many Dataset objects, that are used to create different types of charts. After creating the Dataset object actual chart can be created.