How to generate chart image without invoking JFrame

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mrburns2002
Posts: 6
Joined: Tue Feb 10, 2009 12:50 pm

How to generate chart image without invoking JFrame

Post by mrburns2002 » Mon Apr 06, 2009 4:50 pm

Hi,

as I would like to run JFree Chart on the server without X11, I need to avoid invoking the JPanel window:

My code is like this:

Code: Select all

        JFreeChart jfreechart = createChart(dataset,title,avg_p_value);
        ChartPanel chartPanel = new ChartPanel(jfreechart);
        chartPanel.setPreferredSize(new java.awt.Dimension(635, 405));
        chartPanel.setMouseZoomable(true, false);
        setContentPane(chartPanel);
How can I bypass this this ChartPanel stuff? I need a silent generation of the chart without creating a window.

Any ideas?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: How to generate chart image without invoking JFrame

Post by david.gilbert » Mon Apr 06, 2009 7:58 pm

It depends what you mean by "silent generation of the chart". JFreeChart is generally pretty quiet as it goes about its work. :lol:

The JFreeChart class has various createBufferedImage() methods you could use.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked