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
10
votes
4 answers

How do I change a JFreeChart's size

I've added a JFreeChart to a JPanel (using a BorderLayout), and it's huge. Is there something I can do to make it smaller? public void generateChart() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); //set the values of the…
DannyD
  • 2,732
  • 16
  • 51
  • 73
9
votes
1 answer

dashed line in Jfreechart

Does anybody knows how to draw a vertical dashed line in Jfreechart at some given coordinates ? Thanks
rantravee
9
votes
2 answers

Auto-Scale Y-Axis in JfreeChart

I am using JFreeChart to create candlestick charts in my Java app. However, my charts end up looking like this: http://imageshack.us/photo/my-images/69/capturebhx.png/ I would like to have the Y-axis automatically scaled so that the chart looks…
supercoder
  • 107
  • 1
  • 2
  • 7
9
votes
1 answer

Help with JFreeChart overlay

I'm having an issue with a JFreeChart overlaid graph. I'm using JFreeChart 1.0.13. What I am trying to do seems like it was easier to do in earlier versions of JFreeChart? The graph shows a line chart and a bar chart. The data range plotted by the…
Griff
  • 1,796
  • 3
  • 23
  • 48
9
votes
2 answers

Displaying a histogram of image data

I sometimes need to display a representation of image data in the form of a histogram. I'm especially interested in ways to access the image data. I'm familiar with JFreeChart, which includes histogram support, but I'd consider other approaches.
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
9
votes
2 answers

Changing color of labels in JFreeChart

Anybody that has experience using JFreeChart, is there a way to change the color of my labels for my XY axes. Right now I'm using a XYPlot and I want to change the color of the labels on my axes. Is there a way to do this?
Albinoswordfish
  • 1,949
  • 7
  • 34
  • 50
9
votes
1 answer

histogram in jfreechart

I'm trying to use JfreeChart to create a chart for the histogram of an image , but I don't fully understand how to provide the input data for the histogram .The function I am suppose to use is this: addSeries(java.lang.Comparable key, double[]…
klaus johan
  • 4,370
  • 10
  • 39
  • 56
9
votes
2 answers

Why eclipse doesn't see implemented interfaces?

I've imported jfreechart-fse from here: https://github.com/jfree/jfreechart-fse and I've imported this to eclipse as maven project. After that, I have many problems, for example in class ChartPanel in org.jfree.chart paskage, eclipse doesn't see…
Bernard Burn
  • 661
  • 5
  • 20
9
votes
1 answer

JFreeChart get mouse coordinates

Is there a way in JFreeChart to determine from a ChartMouseEvent that x,y coordinates (in plot space) the mouse is over? I've tried using the domain crosshair value but that seems inaccurate and lags the actual mouse event. thanks, Jeff
Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
9
votes
1 answer

Random errors when changing series using JFreeChart

I'm making a GUI that display result of background calculations. But before that, I wanted to test changing the dataset. Here is my code: DefaultXYDataset dataset = new DefaultXYDataset(); @Override public void run() { //…
aragornsql
  • 121
  • 1
  • 6
9
votes
3 answers

Different color for different series in XYline chart JFreeChart

I have created XY line chart using JFreeChart, having two datasets, I want both the lines to be in different colors. I tried using following code- XYPlot plot = chart.getXYPlot(); XYItemRenderer xyir = plot.getRenderer(); …
Rohit Elayathu
  • 629
  • 6
  • 12
  • 26
8
votes
3 answers

How do I rotate tick mark labels on the domain of a number axis in JFreeChart?

Just like is being done in the following example, I want the tick mark labels on the domain of chart to be rotated 45 degrees as the are in this chart: http://left.subtree.org/2007/08/14/rotate-labels-jfreechart/ The difference is, I want to do this…
Jay Askren
  • 10,282
  • 14
  • 53
  • 75
8
votes
3 answers

Add BufferedImage to PDFBox document

In my current project, I try to add a BufferedImage to a PDFBox document. More specificly, I use an image from a JFreeChart. My code looks like this: public void exportToPDF(JFreeChart chart, String filePath){ PDDocument doc = null; PDPage…
Oglop
  • 260
  • 1
  • 3
  • 11
8
votes
1 answer

Problem implementing JFreeChart

DefaultPieDataset myColoredPieChart = new DefaultPieDataset(); myColoredPieChart.setValue("Java", 12.9); ....... org.jfree.chart.JFreeChart myColoredChart=ChartFactory.createPieChart("Programming - Colored Pie…
Darth Blue Ray
  • 9,445
  • 10
  • 35
  • 48
8
votes
3 answers

How to set line thickness for multiple series in JFreeChart?

I create a lot of charts. In each of them I need to call renderer.setSeriesStroke( i, new BasicStroke( 2.0f ) ); for each series. (renderer is chart.getXYPlot().getRenderer()). I wonder if there is any way to set the thickness globally.
Line
  • 1,529
  • 3
  • 18
  • 42