SkillAgentSearch skills...

Jfreechart

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

Install / Use

/learn @jfree/Jfreechart
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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:

<dependency>
    <groupId>org.jfree</groupId>
    <artifactId>jfreechart</artifactId>
    <version>1.5.6</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:

  • 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 parameter checks.

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
  • 3500621 : LegendTitle order attribute (by Simon Kaczor);
  • 3463807 : ChartComposite does not dispose popup (by Sebastiao Correia);
  • 3204823 : PaintAlpha for 3D effects (by Dave Law);
Bug Fixes
  • 3561093 : Rendering anomaly for XYPlots;
  • 3555275 : ValueAxis.reserveSpace() problem for axes with fixed dimension;
  • 3521736 : DeviationRenderer optimisation (by Milan Ramaiya);
  • 3514487 : SWTGraphics2D get/setStroke() problem;
  • 3508799 : DefaultPolarItemRenderer does not populate seriesKey in LegendItem;
  • 3482106 : Missing text in SWTGraphics2D (by Kevin Xu);
  • 3484408 : Maven fixes (Martin Hoeller);
  • 3484403 : DateAxis endless loop (by Martin Hoeller);
  • 3446965 : TimeSeries calculates range incorrectly in addOrUpdate();
  • 3445507 : `
View on GitHub
GitHub Stars1.4k
CategoryDevelopment
Updated2d ago
Forks626

Languages

Java

Security Score

100/100

Audited on Mar 30, 2026

No findings