jfreechart is a free, open source business intelligence & reporting project written in Java and released under LGPL-2.1. It has 1,392 GitHub stars, 672 forks and 162 open issues, and was last pushed 10 months ago. On this registry it ranks #60 of 77 tracked projects in Business Intelligence & Reporting, with 5 head-to-head comparisons available.

What is jfreechart?

JFreeChart is a free, open-source 2D chart library for the Java platform that works in JavaFX and Swing clients or on the server side, and it is built for Java developers who need to render and export charts without depending on a commercial charting product.

What it is

JFreeChart is a comprehensive chart library for the Java platform, distributed under the GNU Lesser General Public License version 2.1 or later. It targets JavaFX and Swing on the client side, and it can also run on the server side, with export to multiple formats including SVG, PNG and PDF. It requires JDK 11 or later; Java 8 remains supported through the v1.5.x branch. It lives in the JVM ecosystem and is published on Maven Central as org.jfree:jfreechart, with JavaFX support provided by the separate JFreeChart-FX extensions project.

The concrete problem it solves is the amount of bespoke work that otherwise sits between a Java application and a finished chart. Instead of writing custom raster and vector drawing code and a separate export path for each output format, an application configures a chart object and renders it either into a Swing ChartPanel, a JavaFX scene, or a headless server-side process that emits SVG, PNG or PDF. The library also absorbs the churn of that surface: version 1.5.0 integrated the JCommon classes into the JFreeChart jar under different packages, renamed getBaseXXX()/setBaseXXX() methods to getDefaultXXX()/setDefaultXXX(), renamed ChartUtilities to ChartUtils, and renamed org.jfree.chart.utils.ParamChecks to org.jfree.chart.utils.Args.

Key capabilities

  • Renders 2D charts for JavaFX and Swing clients as well as server-side use, from a single chart model.
  • Exports to SVG, PNG and PDF, covering both vector and raster output.
  • Published to Maven Central as org.jfree:jfreechart, currently documented at version 1.5.6.
  • Provides JavaFX integration through the JFreeChart-FX extensions at jfree/jfreechart-fx.
  • Requires JDK 11 or later to build and run, with a v1.5.x branch retained for Java 8.
  • Removed pseudo-3D chart classes in 1.5.0 and points users to Orson Charts for 3D instead.
  • Carries unreleased 2.0.0 work: a modified ChartPanel buffer for high DPI displays, options controlling pan versus zoom, ThreadLocal calendars in time series datasets, padding for Crosshair labels, and a valueVisible flag on MeterPlot.

Who uses it and how

  • Desktop Java teams embedding charts directly in Swing applications through ChartPanel, including the high DPI buffer handling added on the 2.0.0 line.
  • JavaFX application developers who add charting through the separate JFreeChart-FX extensions project rather than the core jar alone.
  • Server-side and headless workloads that generate chart images on demand and export them to PNG, SVG or PDF as part of a reporting pipeline.
  • Developers evaluating the library who run the reference applications in the JFree-Demos and JFree-FXDemos repositories before adopting it.
  • Teams migrating an existing 1.0.x codebase, who must update imports, rename getBaseXXX()/setBaseXXX() calls, switch ChartUtilities to ChartUtils, and drop any reliance on SegmentedTimeline.

Getting started

Add the dependency org.jfree:jfreechart version 1.5.6 to the build tool, or build from source with mvn clean install from the project root using JDK 11 or later.

How it compares

Within the JFree family, JFreeChart handles 2D charts while Orson Charts covers 3D, a split the project made explicit when it removed the pseudo-3D chart classes in version 1.5.0 rather than maintain them. The JFreeChart-FX extensions sit alongside the core jar for JavaFX applications, so a JavaFX project typically pairs both rather than choosing between them. A more extensive demo set and the JFreeChart Developer Guide are available as rewards at most tiers of the JFree sponsorship program.

When to use it — and when not to

JFreeChart is a library rather than a service, so there is no database, object storage or mail server to operate; the operational cost is a JDK 11 or later runtime, whether that is a desktop client or a headless JVM generating exports. Projects that need 3D rendering should not choose it, because that code was deliberately removed in favour of Orson Charts, and anyone redistributing it inside a closed product needs to be comfortable with the LGPL 2.1 terms. The main caveat is version state: the README title advertises version 2.0.0 as not yet released while the dependency snippet still points at 1.5.6, and the repository carries 162 open issues, so adopters should expect to track an unreleased line for the newest fixes.

project readme (upstream, from github) — read inline

JFreeChart

Version 2.0.0, not yet released.

Maven Central javadoc

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:

https://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:

    org.jfree
    jfreechart
    1.5.6

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:

  • all the classes from JCommon that are used by JFreeChart have integrated within the JFreeChart jar file within a different package than before (you will need to change your imports);
  • many methods getBaseXXX()/setBaseXXX() have been renamed setDefaultXXX()/getDefaultXXX();
  • the ChartUtilities class has been renamed ChartUtils;
  • all the classes relating to pseudo-3D charts have been removed, as much better 3D charts are offered by Orson Charts so we prefer not to maintain the pseudo-3D chart code within JFreeChart;
  • the SegmentedTimeline class has been removed due to being (a) complex, (b) not always being correct and, as a result, generating too many support requests;
  • the org.jfree.chart.utils.ParamChecks class has been renamed org.jfree.chart.utils.Args.

Please refer to Issue 66 for additional info.

History

Version 2.0 (not yet released)
  • add padding for Crosshairlabel (#414)
  • add tests for EncoderUtil (#378)
  • use ThreadLocal for calendars in time series datasets (#171);
  • added valueVisible flag to MeterPlot (#231);
  • modify buffer in ChartPanel to handle high DPI displays (#170);
  • add options to control pan vs zoom in ChartPanel (#172);
  • observe series visibility flags in ClusteredXYBarRenderer (#89);
  • observe axis visibility flag in PeriodAxis (#198);
  • fix for exception on extreme zoom on NumberAxis (bug #64);
  • fix tick label font for LogAxis with number format override (#98);
  • remove alpha channel from copy-to-clipboard (fixes bug #182);
  • apply rendering hints to overlays - fixes bug #187;
  • modify TextTitle to throw IllegalArgumentException rather than NullPointerException (#205);
  • fix bugs on crosshair labels (#189, #194);
  • removed ObjectUtils class (#163);
  • removed unused URLUtilities class (#162)
  • fixed LayeredBarRenderer (bugs #169 and #175);
  • minor fix for DefaultPieDataset (bugs #212)
  • fix isJFreeSVGAvailable() method (bugs #207)
  • add new methods to access maps for datasets, renderers and axes in plots (#201);
  • update French translations (bug #186);
  • fix "Save_as" entries in localisation files (bug #184);
  • add flags for visibility of outliers in BoxAndWhiskerRenderer (#79);
  • added generics;
  • DefaultIntervalCategoryDataset no longer allows null keys in constructor (this is a consequence of introducing generics);
  • update required JDK to version 11.
Version 1.5.0 (5 November 2017)
  • all JavaFX classes moved to a separate project;
  • added cleaner method to create histograms in ChartFactory;
  • JCommon removed as a dependency, and required classes incorporated directly (including package rename);
  • pull request #4 improvements to XYStepRenderer;
  • bug #36 fix for crosshairs with multiple datasets / axes;
  • bug #25 fix for DateAxis.previousStandardDate() method;
  • bug #19 fix for default time zone in SegmentedDateAxis;
  • SourceForge #1147 improve performance of CategoryPlot mapping datasets to axes;
  • moved SWT code out into separate projects;
  • moved demo programs to a separate project;
  • dropped the Ant build;
Version 1.0.19 (31-Jul-2014)
  • fixed clipping issues for combined plots in JavaFX;
  • fixed a memory leak in the new JavaFX ChartCanvas class;
  • CombinedDomainXYPlot and CombinedRangeXYPlot now take into account the pannable flags in the subplots;
  • FastScatterPlot panning direction is corrected;
  • added rendering hints to sharpen gridlines and borders in most output formats;
  • JFreeSVG updated to version 2.0;
  • included a preview of JSFreeChart, a 2D chart library written in JavaScript that is conceptually similar to JFreeChart but runs directly in a web browser.
Version 1.0.18 (3-Jul-2014)
  • added JavaFX support via FXGraphics2D;
  • improved LogAxis labelling;
  • improved numeric tick labelling;
  • center text support in RingPlot;
  • stepPoint attribute in the XYStepAreaRenderer;
  • other minor improvements and bug fixes.
Version 1.0.17 (22-Nov-2013)
  • Enhanced XYSplineRenderer with new area fill (contributed by Klaus Rheinwald);
  • added a notify flag to all datasets that extend AbstractDataset;
  • extended TimeSeriesCollection to validate TimeSeries keys for uniqueness;
  • added a new DirectionalGradientPaintTransformer (by Peter Kolb);
  • updated OHLCSeries;
  • added HMSNumberFormat;
  • updated JCommon to version 1.0.21 (includes rotated text improvements) and fixed some minor bugs.
Bug Fixes
  • 977 : Multithreading issue with DateAxis;
  • 1084 : BorderArrangement.add() possible ClassCastException;
  • 1099 : XYSeriesCollection.removeSeries(int) does not deregister listener;
  • 1109 : WaterfallBarRenderer uses wrong color for diff 0.
Version 1.0.16 (13-Sep-2013)

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

  • Provided subscript/superscript support for axis labels (via AttributedString);
  • new axis label positioning options;
  • simplified ChartFactory methods;
  • added new methods to DatasetUtilities to interpolate y-values in XYDatasets;
  • added URLs to labels on CategoryAxis;
  • seamless integration with JFreeSVG (https://www.jfree.org/jfreesvg/) and OrsonPDF (http://www.object-refinery.com/pdf/);
  • improved the consistency of the SWTGraphics2D implementation;

All the JUnit tests have been upgraded to JUnit 4.

Bug Fixes
  • 1107 : Fixed TimeZone issue in PeriodAxis;

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)
  • Added support for non-visible series in XYBarRenderer;
  • minor gridlines in PolarPlot;
  • legend item ordering;
  • chart editor enhancements;
  • updates to StandardDialScale;
  • localisation files for Japanese;
  • refactored parame

readme truncated — read the full docs on github

Frequently asked questions

Is jfreechart free to use?

jfreechart is open source under the LGPL-2.1 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does jfreechart do?

A 2D chart library for Java applications (JavaFX, Swing or server-side).

What is jfreechart written in?

jfreechart is primarily written in Java. Its source is publicly available at https://github.com/jfree/jfreechart, and it has 1,392 GitHub stars.