Questions tagged [jfreechart]

JFreeChart is a free Java chart library with many available chart types and support for numerous output types. The latest version is 1.5.0 released on 2017-11-05. The license is LGPLv2 (or later).

JFreeChart is a free Java chart library with many available chart types and support for numerous output types. The project includes a gallery of sample charts and detailed examples of several basic chart types; click on the relevant link to see the corresponding source. In addition, older examples may be found here, and a list of frequently asked questions is available; addenda appear in the maintainer's support forum and discussions area.

Its source code is on GitHub. Current and previous versions of JFreeChart can be obtained from Maven.org. Releases are seen here. The online javadoc API are listed here. The creator also provides a Developer Guide document which can be purchased here.

Frequently asked questions are present here.

Requirements

JFreeChart requires the Java platform. Note that JFreeChart is a class library for use by developers, not an end user application.

Related Links:

2745 questions
5
votes
1 answer

How can multiple datasets be used with JFreeChart?

How could I add to a plot an OHLCSeriesCollection and a TimeSeriesCollection , in order to represent their values in the same chart ?
klaus johan
  • 4,370
  • 10
  • 39
  • 56
5
votes
1 answer

JFreeChart TimeSeries Chart remove days with no value

Is there a simple way to remove days with no value? Here is some of my data 12-04-2012 => 15 13-04-2012 => 12 15-04-2012 => 10 16-04-2012 => 5 In chart 14-04-2012 is painted. I mean, theres a longer line between 13-04 and 15-04. Is it possible to…
Krystian
  • 996
  • 9
  • 24
5
votes
2 answers

JBoss AS7 app deployed on a Mac can't find com.apple.laf.AquaLookAndFeel

We're migrating to JBoss AS7 from an older version of JBoss and we use JFreeChart in one part of our app: chart = ChartFactory.createStackedBarChart( "", "", "Data", dataset, PlotOrientation.HORIZONTAL, true, false, false ); When we hit…
Chris Williams
  • 11,647
  • 15
  • 60
  • 97
4
votes
1 answer

jfreechart - remove spaces in chart

I am using JFreeChart, and I want to remove the left and right spaces in my waterfall chart. Here is what my chart looks like right now with the red squiggles to demonstrate the space I want to remove. Any idea how to remove these spaces?
Steven
  • 3,844
  • 3
  • 32
  • 53
4
votes
1 answer

JFreeChart to represent 3D data in a 2D graph using colourmaps

I'm currently trying to use JFreeChart to represent 3D data in a 2D graph. Essentially, I have a 2d array called data[i][j]. The i and j represent the y and x coordinates where I want to plot. The value of data[i][j] represents a frequency value,…
Akib
  • 41
  • 1
  • 2
4
votes
1 answer

Toggle upper bound of JFreeChart axis range

I have a chart that graphs number of tasks completed versus time. On the Y-axis, 0 is always included and there is a fixed value that will be the maximum number of tasks. As time progresses, the line of the series climbs up to the maximum value. I…
unholysampler
  • 17,141
  • 7
  • 47
  • 64
4
votes
2 answers

JFreeChart MouseListener doesn't resolve chart elements

I've got stacked bar chart where I want to be able to select individual bars in the stack. But ChartMouseListener doesn't resolve ChartMouseEvent into corresponding ChartEntity. Here's the listener snippet : public void…
Dima
  • 4,068
  • 4
  • 38
  • 47
4
votes
1 answer

Changing mercury color in thermometer in JFreeChart

I have created a thermometer chart with JFreeChart, but I want to change the mercury color in thermometer. How can I do this? Here is my code so far; please explain where to change this code: final DefaultValueDataset dataset = new…
praveen
  • 35
  • 2
  • 4
4
votes
1 answer

Prevent Main UI to collapse from child thread

I have this code: class FinalUI1 extends javax.swing.JFrame { //do something Thread t; try { t = new Thread(new PcapTool(null)); t.start(); } catch (InterruptedException e) { …
David Prun
  • 8,203
  • 16
  • 60
  • 86
4
votes
1 answer

Set Width of XYSeries JfreeChart

Can someone help me to know how to set the width of bar in this x-y graph from JFreeChart. Thank you very much. final XYSeries series = new XYSeries("Analysis"); series.add(22.0,33.1); series.add(32.0,33.1); …
David Prun
  • 8,203
  • 16
  • 60
  • 86
4
votes
2 answers

Jfreechart XYPlot, how can i draw a legend into the Plot-Area?

i'm drawing several charts with XY-Plots in my application. I have no problem displaying a legend under (or on top, left or right of) the plot. But to save space i want to draw a legend-box into the XY-Plot. I'm able to draw image-,text- and…
Une
  • 41
  • 1
  • 2
4
votes
2 answers

jfreechart - change sample of colors in legend

Can someone tell me how to change samples of series color in legend in jfreechart. What I have now is small line of series color eg: I would like to have square sample of those colors. Here is an example Can someone help me? Ok I found the solution.…
Darek
  • 191
  • 1
  • 2
  • 9
4
votes
1 answer

Adding points to XYSeries dynamically with JfreeChart

I am facing problems in adding points to XYSeries. I have two classes. One is Sample (it has a main method) and the other class is JfreeChart (it has JfreeChart Code). In my Sample class I have a 2D array sample[row][2] which has initially 10 rows,…
Sam
  • 603
  • 3
  • 7
  • 17
4
votes
1 answer

Jfreechart - how to add a legend item with a dash?

I want to add a legend item with a dash (-) to denote some series in my chart. The default shape provided are only Plot.DEFAULT_LEGEND_ITEM_CIRCLE and Plot.DEFAULT_LEGEND_ITEM_BOX. Is there something like Plot.DEFAULT_LEGEND_ITEM_LINE ? How to…
sam
  • 651
  • 3
  • 9
  • 16
4
votes
1 answer

retrieve data set having only a ChartPanel reference (Java + JFreeChart)

This question in partially related to my previous post on this subject. I would like to know after a ChartPanel has been constructed : public ChartPanel buildChart(){ XYSeriesCollection dataset = new XYSeriesCollection(); ... FreeChart chart…
Heisenbug
  • 38,762
  • 28
  • 132
  • 190