Home

Awesome

JFreeChart

Version 2.0.0, not yet released.

Maven Central

Overview

JFreeChart is a comprehensive free chart library for the Java™ platform that can be used on the client-side (JavaFX and Swing) or the server side, with export to multiple formats including SVG, PNG and PDF.

JFreeChart sample

The home page for the project is:

http://www.jfree.org/jfreechart

JFreeChart requires JDK 11 or later. For Java 8 support, check the v1.5.x branch.

The library is licensed under the terms of the GNU Lesser General Public License (LGPL) version 2.1 or later.

JavaFX

JFreeChart can be used with JavaFX via the JFreeChart-FX extensions:

https://github.com/jfree/jfreechart-fx

Demos

A small set of demo applications can be found in the following projects here at GitHub:

A more comprehensive set of demos, plus the JFreeChart Developer Guide, is a reward at most tiers of the JFree sponsorship program. Thanks for supporting the JFree projects!

For Developers

Using JFreeChart

To use JFreeChart in your projects, add the following dependency to your build tool:

<dependency>
    <groupId>org.jfree</groupId>
    <artifactId>jfreechart</artifactId>
    <version>1.5.3</version>
</dependency>

Building JFreeChart

You can build JFreeChart using Maven by issuing the following command from the root directory of the project:

mvn clean install

The build requires JDK 11 or later.

Migration

When migrating from JFreeChart 1.0.x to JFreeChart 1.5.0, please be aware of the following API changes:

Please refer to Issue 66 for additional info.

History

Version 2.0 (not yet released)
Version 1.5.0 (5 November 2017)
Version 1.0.19 (31-Jul-2014)
Version 1.0.18 (3-Jul-2014)
Version 1.0.17 (22-Nov-2013)
Bug Fixes
Version 1.0.16 (13-Sep-2013)

*** THIS RELEASE REQUIRES JDK/JRE 1.6.0 OR LATER. ***

All the JUnit tests have been upgraded to JUnit 4.

Bug Fixes

Also fixed a line drawing issue with the StackedXYAreaRenderer, and a memory leak in the SWT ChartComposite class.

Version 1.0.15 (4-Jul-2013)

This release also fixes a minor security flaw in the DisplayChart class, detected and reported by OSI Security:

http://www.osisecurity.com.au/advisories/jfreechart-path-disclosure

Patches
Bug Fixes

Also fixed a rendering issue for polar charts using an inverted axis.

Version 1.0.14 (20-Nov-2011)

This release contains:

Patches
Bug Fixes

Also fixed:

Version 1.0.13 (17-Apr-2009)

SPECIAL NOTICE: There will be a birds-of-a-feather session for JFreeChart at this year's JavaOne conference in San Francisco. The session is scheduled for 6.45pm to 7.35pm on Wednesday 3 June.

This release contains:

Bug Fixes

In addition, a bug in the SlidingCategoryDataset class has been fixed, the correct outline paint is now used by GradientXYBarPainter, a new method has been added to the ImageMapUtilities class to escape special characters in Javascript strings to avoid problems with the OverLIB and DynamicDrive tooltips, and there are some important fixes in the LogAxis class.

This release passes 2110 JUnit tests (0 failures) on JRE 1.6.0_12.

Version 1.0.12 (31-Dec-2008)

This release adds

This release passes 1996 JUnit test (0 failures) on JRE 1.6.0_10.

API Adjustments
Bug Fixes

Also fixed StackedXYBarRenderer which was ignoring the shadowsVisible attribute.

Version 1.0.11 (18-Sep-2008)

This release features:

There is an important bug fix for the StackedBarRenderer3D class (see bug 2031407).

This release passes 1,961 JUnit tests (0 failures) on JRE 1.6.0_07.

API Adjustments
Patches
Bug Fixes

Also fixed drawing of alternate grid bands in SymbolAxis, the totalWeight calculation in the CombinedXXXPlot classes, a NullPointerException in the XYPlot class when drawing quadrants, outline visibility in the CategoryPlot class, and auto-range calculations with XYBarRenderer.

Version 1.0.10 (8-Jun-2008)

This release contains various bug fixes and minor enhancements to JFreeChart.

This release passes 1,929 JUnit tests (0 failures) on JRE 1.6.0_03.

API Adjustments:

PublicCloneable is now implemented by a number of classes that didn't previously implement the interface - this should improve the reliability of chart cloning.

Patches
Bug Fixes

The DatasetUtilities.sampleFunction2D() has been changed to sample the correct number of points - you should check any code that calls this method. The XYBlockRenderer class now generates entities. Bugs in the removeDomainMarker() and removeRangeMarker() methods in the CategoryPlot and XYPlot classes have been fixed. A bug in the TimePeriodValues range calculation has been fixed. Fixes were applied to the clone() methods in the TaskSeries and TaskSeriesCollection classes.

New Experimental Features

Two new classes CombinedCategoryPlot and CombinedXYPlot have been added to the 'experimental' source tree - these were contributed by Richard West (see patch 1924543).

Version 1.0.9 (4-Jan-2008)

This release contains an important security patch as well as various bug fixes and minor enhancements. Regarding the security patch, please see the following advisory:

http://www.rapid7.com/advisories/R7-0031.jsp

Note that the fix incorporated in the special JFreeChart 1.0.8a release was flawed in that it broke the URLs in the HTML image maps generated by JFreeChart. Further amendments have been made in this release to fix this problem.

API Adjustments

A number of classes have new methods. Nothing has been removed or deprecated:

Bug Fixes

In addition, a bug in the constructor for the Week class has been fixed.

Version 1.0.8 (23-Nov-2007)

This release is primarily a bug fix release:

In addition:

Version 1.0.7 (14-Nov-2007)

This release features

API Adjustments
Patches
Bug Fixes
Version 1.0.6 (15-Jun-2007)

This release features:

API Adjustments
Bug Fixes

Plus the following bugs that didn't have entries in the database:

Version 1.0.5 (23-Mar-2007)

This release features:

API Adjustments
Bug Fixes

Also fixed numerous bugs in equals(), cloning and serialization implementations.

Version 1.0.4 (9-Feb-2007)

This release features:

API Adjustments
Bug Fixes

Also fixed numerous bugs in equals() and clone() methods throughout the API.

Version 1.0.3 (17-Nov-2006)

This release features:

A new DialPlot implementation has been added to the 'experimental' sources. We are looking for people to test this code and provide feedback, so that we can stabilize the API and add this code to the main JFreeChart API.

API adjustments

The following adjustments have been made to the API:

Bug Fixes

Also fixed URL generation for legend items, tick mark positioning on the DateAxis, the equals() method in the AreaRenderer class, hardcoded outline attributes in the XYBubbleRenderer, and potential NullPointerExceptions in the ChartPanel class.

Version 1.0.2 (25-Aug-2006)
API adjustments

The following adjustments have been made to the API (there should be no breakage of applications coded to the 1.0.0 or 1.0.1 API):

Patches
Bug Fixes
Miscellaneous Changes
Experimental Code

In this release, some new (incomplete) classes have been included in the org.jfree.experimental.* namespace. These classes are not part of the standard API, but are included for developers to experiment with and provide feedback on. Hopefully in the future, refined versions of these classes will be incorporated into the main library. PLEASE NOTE THAT THE API FOR THESE CLASSES IS SUBJECT TO CHANGE.

Version 1.0.1 (27-Jan-2006)

This is primarily a bug fix release. In addition, there are some API adjustments (there should be no breakage of applications coded to the 1.0.0 API).

API adjustments
Bug fixes
Version 1.0.0 (2-Dec-2005)
Version 1.0.0-rc3 (28-Nov-2005)
Version 1.0.0-rc2 (25-Nov-2005)
Version 1.0.0-rc1 (2-Jun-2005)
Version 1.0.0-pre2 (10-Mar-2005)
Version 1.0.0-pre1 (29-Nov-2004)
Version 0.9.21 (9-Sep-2004)
Version 0.9.20 (7-Jun-2004)
Version 0.9.19 (28-May-2004)
Version 0.9.18 (15-Apr-2004)
Version 0.9.17 (26-Mar-2004)
Version 0.9.16 (09-Jan-2004)
Version 0.9.15 (28-Nov-2003)
Version 0.9.14 (17-Nov-2003)
Version 0.9.13 (26-Sep-2003)
     - various enhancements to the stacked area XY charts;
     - added a completion indicator for the Gantt chart;
     - range and domain markers can now be placed in the foreground or the
       background;
     - more fixes for cloning and serialization;
     - fixed mouse event bug for combined charts;
     - fixed bugs in the PngEncoder class;
     - incorporated .properties files that were missing from the 0.9.12
       distribution;
Version 0.9.12 (11-Sep-2003)
     - extended box-and-whisker plots to work with the CategoryPlot class
       as well as the XYPlot class (based on work by David Browning);
     - added a new LayeredBarRenderer (by Arnaud Lelievre);
     - added support for stacked area charts with the XYPlot class (thanks
       to Richard Atkinson);
     - improved HTML image map support (thanks to Richard Atkinson);
     - added localized resources for the chart property editors (thanks to
       Arnaud Lelievre).  Current translations include French and Portugese
       (thanks to Eduardo Ramalho);
     - added facility for setting all rendering hints;
     - improved support for cloning and serialization;
     - fixed a bug in the XYSeries class that prevented the TableXYDataset
       from functioning correctly;
     - improved date axis labelling with segmented time lines;
     - fixed several bugs in the secondary dataset/axis/renderer code;
     - fixed bugs in the JDBCCategoryDataset class;
     - numerous other bug fixes;
Version 0.9.11 (8-Aug-2003)
     - added support for box-and-whisker plots, thanks to David Browning;
     - lots of bug fixes;
Version 0.9.10 (25-Jul-2003)
     - added support for multiple secondary axes, datasets and
       renderers;
     - minor feature enhancements and bug fixes;
Version 0.9.9 (10-Jul-2003)

PLEASE NOTE THAT MAJOR CHANGES HAVE BEEN MADE IN THIS RELEASE AND ONE OR TWO FEATURES MAY BE BROKEN. PLEASE REPORT BUGS SO THEY CAN BE FIXED FOR THE NEXT RELEASE.

    - merged the HorizontalCategoryPlot and VerticalCategoryPlot classes,
      into the CategoryPlot class;
    - merged the horizontal and vertical axis classes;
    - merged the horizontal and vertical renderer classes;
    - CategoryPlot and XYPlot now support both horizontal and vertical
      orientation via the setOrientation(...) method;
    - merged horizontal and vertical methods in the ChartFactory class;
    - created new combined plot classes: CombinedDomainCategoryPlot,
      CombinedRangeCategoryPlot, CombinedDomainXYPlot and
      CombinedRangeXYPlot (these can all be drawn with a horizontal or
      vertical orientation);
    - Bill Kelemen has enhanced the DateAxis class to handle segmented
      timelines.  This can be used, for example, to skip weekends for
      daily stock price charts;
    - Richard Atkinson has updated the ServletUtilities class;
    - Bryan Scott has added an XYDatasetTableModel class for presenting
      datasets in a JTable;
    - modified XYPlot to allow renderers to use multiple passes through
      the dataset;
    - added new XYDifferenceRenderer;
    - added support for colored bands between gridlines in XYPlot;
    - added new XYDrawableAnnotation class;
    - added a new attribute to control the order of dataset rendering in
      a CategoryPlot;
    - extended the value label mechanism for the renderers, to allow
      better (per series) control over label generation, positioning and
      visibility;
    - CategoryItemTooltipGenerator has been renamed
      CategoryItemLabelGenerator, since it is now being used to generated
      item labels as well as tooltips;
    - there is now support for horizontal stacked 3D bar charts;
    - added support for range markers against secondary axis in a
      CategoryPlot;
    - added labels to domain and range markers;
    - added a new HistogramDataset class (contributed by Jelai Wang) to
      make it easier to create histograms with JFreeChart;
    - moved the DrawingSupplier into the plot class, renderers now
      reference the supplier from the plot (parent plot for combined and
      overlaid charts).  This means that renderers now share a single
      DrawingSupplier by default, which simplifies the creation of
      combined charts;
    - changed the ColorBarAxis classes that extended the NumberAxis class,
      to a single ColorBar class that wraps a ValueAxis (may have broken
      one or two things in the process);
    - Barak Naveh has contributed new classes MatrixSeries and
      MatrixSeriesCollection, along with demos:  BubblyBubblesDemo.java
      and BubblyBubblesDemo2.java;
    - the TextTitle class now has a background paint attribute;
    - the StandardLegend class now generates LegendEntity objects if a
      ChartRenderingInfo instance is supplied to the draw(...) method;
    - extended the CategoryTextAnnotation class to take into account a
      category anchor point.  See the SurveyResultsDemo.java application
      for an example;
    - included numerous bug fixes;
Version 0.9.8 (24-Apr-2003)
    - changed package naming from com.jrefinery.* to org.jfree.*;
    - added new TimePeriodValuesCollection class;
    - added MIME type code to ServletUtilities class;
    - reversed the order of PieDataset and KeyedValuesDataset in
      the class hierarchy;
    - reversed the order of CategoryDataset and KeyedValues2DDataset
      in the class hierarchy;
    - minor bug fixes;
Version 0.9.7 (11-Apr-2003)
    - added a new ValueDataset interface and DefaultValueDataset
      class, and changed the CompassPlot class to use this instead
      of MeterDataset;
    - added DataUtilities class, to support creation of Pareto
      charts (new demo included);
    - updated writeImageMap method as suggested by Xavier Poinsard
      (see Feature Request 688079);
    - implemented Serializable for most classes (this is likely to
      require further testing);
    - incorporated contour plot updates from David M. O'Donnell;
    - added new CategoryTextAnnotation and XYLineAnnotation
      classes;
    - added new HorizontalCategoryAxis3D class contributed by
      Klaus Rheinwald;

    Bug fixes:
    - added a workaround for JVM crash (a JDK bug) in pie charts
      with small sections (see bug report 620031);
    - fixed minor bug in HorizontalCategoryPlot constructor (see
      bug report 702248);
    - added code to ensure HorizontalNumberAxis3D is not drawn if
      it is not visible (see bug report 702466);
    - added small fix for suppressed chart change events (see bug
      report 690865);
    - added pieIndex parameter to tooltip and URL generators for
      pie charts;
    - fixed bug in getLastMillisecond() method for the Second
      class and the getFirstMillisecond() method for the Year
      class (picked up in JUnit tests);
    - in TextTitle, changed width used for relative spacing to fix
      bug 703050;
Version 0.9.6 (17-Feb-2003) Bug fixes:
    - fixed null pointer exception in DefaultCategoryDataset;
    - fixed update problem for PaintTable, StrokeTable and
      ShapeTable objects;
    - added methods to control colors in PiePlot (these were
      inadvertantly removed in the changes made for 0.9.5);
    - fixed auto-range update problem for secondary axis;
    - fixed missing category labels in the overlaid category plot;
    - fixed constructors for symbolic axes;
    - corrected error in Javadoc generation (Ant script);
Version 0.9.5 (6-Feb-2003)

PLEASE NOTE THAT MAJOR CHANGES TO THE JFREECHART API HAVE BEEN MADE IN THIS RELEASE!

    - added support for secondary axes, datasets and renderers;
    - added new data interfaces (Value, Values, Values2D,
      KeyedValues and KeyedValues2D) and incorporated these into
      the existing PieDataset and CategoryDataset interfaces.
    - modified the CategoryDataset interface to be more
      symmetrical, data is organised in rows and columns (as
      before) but can now be accessed by row/column index or
      row/column key.
    - added support for reading PieDatasets and CategoryDatasets
      from XML files.
    - created separate packages for the axes
      (com.jrefinery.chart.axis), plots (com.jrefinery.chart.plot)
      and renderers (com.jrefinery.chart.renderer).
    - series attributes (paint, outline paint, stroke and shape)
      are now controlled by the renderer classes using lookup
      tables.  Introduced the DrawingSupplier interface (and
      DefaultDrawingSupplier class) which is used to populate the
      lookup tables from a common source (necessary to coordinate
      complex combined charts).
    - the chart legend can now display shapes corresponding to
      series.
    - moved responsibility for category distribution to the
      CategoryAxis class, which tidies up the code in the
      CategoryPlot classes.
    - gridlines are now controlled by the CategoryPlot and XYPlot
      classes, not the axes (included in this change is the
      addition of gridlines for the CategoryPlot domain values).
    - changed the list of titles in the JFreeChart class to a
      title and a list of subtitles.
    - added new renderers for XYPlot (XYBubbleRenderer and
      YIntervalRenderer).
    - modified Gantt chart to display sub-tasks.
    - added ContourPlot class (still experimental) by David
      M. O'Donnell.
    - introduced new MovingAverage class.
    - ChartMouseEvent now includes source chart.
    - numerous bug fixes.
    - lots of Javadoc updates.
Version 0.9.4 (18-Oct-2002)

Added a new stacked area chart (contributed by Dan Rivett) and a compass plot (contributed by Bryan Scott). Updated the ThermometerPlot class. Added a new XYDotRenderer for scatter plots. Modified combined and overlaid plots to use the series colors specified in the sub plot rather than the parent plot (this makes it easier to align the colors in the legend). Added Regression class for linear and power regressions. BasicTimeSeries can now automatically drop "old" data. Some clean-up work in the code for tooltips and the event listener mechanism. Richard Atkinson has incorporated some useful extensions for servlets/JSP developers.

    Ran Checkstyle and corrected issues reported for most classes.
    Checkstyle is a free utility that you can download from:

        http://checkstyle.sourceforge.net

    Fixed bugs and updated documentation.

    API changes include:
    - added tickMarkPaint to Axis constructor (also affects
      subclasses);
    - added getLegendItems() to Plot, and deprecated
      getLegendItemLabels();
    - added getLegendItem(int) to XYItemRenderer and
      CategoryItemRenderer.
    - most 'protected' member variables have been changed to
      'private'.
Version 0.9.3 (4-Sep-2002)

Bug fixes:

The CVS repository at SourceForge has also been restructured to match the distribution directory layout.

Version 0.9.2 (28-Jun-2002)

######Bug fixes

Version 0.9.1 (14-Jun-2002)

Bug fixes and Javadoc updates.

Version 0.9.0 (7-Jun-2002)
Version 0.8.1 (5-Apr-2002)
Version 0.8.0 (22-Mar-2002)
Version 0.7.4 (6-Mar-2002)
Version 0.7.3 (14-Feb-2002)

Bug fixes.

Version 0.7.2 (8-Feb-2002)
Version 0.7.1 (25-Jan-2002)
Version 0.7.0 (11-Dec-2001)
Version 0.6.0 (27-Nov-2001)

CONTRIBUTORS

JFreeChart wouldn't be half the library that it is today without the contributions (large and small) that have been made by the developers listed below:

It is possible that I have missed someone on this list, if that applies to you, please e-mail me.

Dave Gilbert (david.gilbert@object-refinery.com)

JFreeChart Project Leader