org.jfree.chart
Class JFreeChart

public class JFreeChart
implements Drawable, TitleChangeListener, PlotChangeListener, Serializable, Cloneable
A chart class implemented using the Java 2D APIs. The current version supports bar charts, line charts, pie charts and xy plots (including time series data).

JFreeChart coordinates several objects to achieve its aim of being able to draw a chart on a Java 2D graphics device: a list of Title objects (which often includes the chart's legend), a Plot and a Dataset (the plot in turn manages a domain axis and a range axis).

You should use a ChartPanel to display a chart in a GUI.

The ChartFactory class contains static methods for creating 'ready-made' charts.

SinceNot specified.
VersionNot specified.
AuthorNot specified.
Wiki javadoc Use textile entry format.

hh

Field Summary
static Image DEFAULT_BACKGROUND_IMAGE
The default background image.
static int DEFAULT_BACKGROUND_IMAGE_ALIGNMENT
The default background image alignment.
static float DEFAULT_BACKGROUND_IMAGE_ALPHA
The default background image alpha.
static Paint DEFAULT_BACKGROUND_PAINT
The default background color.
static Font DEFAULT_TITLE_FONT
The default font for titles.
static ProjectInfo INFO
Information about the project.
Constructor Summary
JFreeChart( Plot plot )
Creates a new chart based on the supplied plot.
JFreeChart( String title, Plot plot )
Creates a new chart with the given title and plot.
JFreeChart( String title, Font titleFont, Plot plot, boolean createLegend )
Creates a new chart with the given title and plot.
Method Summary
void addChangeListener( ChartChangeListener listener )
Registers an object for notification of changes to the chart.
void addLegend( LegendTitle legend )
Adds a legend to the plot and sends a ChartChangeEvent to all registered listeners.
void addProgressListener( ChartProgressListener listener )
Registers an object for notification of progress events relating to the chart.
void addSubtitle( Title subtitle )
Adds a chart subtitle, and notifies registered listeners that the chart has been modified.
void clearSubtitles()
Clears all subtitles from the chart and sends a ChartChangeEvent to all registered listeners.
Object clone()
Clones the object, and takes care of listeners.
BufferedImage createBufferedImage( int width, int height )
Creates and returns a buffered image into which the chart has been drawn.
BufferedImage createBufferedImage( int width, int height, ChartRenderingInfo info )
Creates and returns a buffered image into which the chart has been drawn.
BufferedImage createBufferedImage( int width, int height, int imageType, ChartRenderingInfo info )
Creates and returns a buffered image into which the chart has been drawn.
BufferedImage createBufferedImage( int imageWidth, int imageHeight, double drawWidth, double drawHeight, ChartRenderingInfo info )
Creates and returns a buffered image into which the chart has been drawn.
void draw( Graphics2D g2, Rectangle2D area )
Draws the chart on a Java 2D graphics device (such as the screen or a printer).
void draw( Graphics2D g2, Rectangle2D area, ChartRenderingInfo info )
Draws the chart on a Java 2D graphics device (such as the screen or a printer).
void draw( Graphics2D g2, Rectangle2D chartArea, Point2D anchor, ChartRenderingInfo info )
Draws the chart on a Java 2D graphics device (such as the screen or a printer).
protected EntityCollection drawTitle( Title t, Graphics2D g2, Rectangle2D area, boolean entities )
Draws a title.
boolean equals( Object obj )
Tests this chart for equality with another object.
void fireChartChanged()
Sends a default ChartChangeEvent to all registered listeners.
boolean getAntiAlias()
Returns a flag that indicates whether or not anti-aliasing is used when the chart is drawn.
Image getBackgroundImage()
Returns the background image for the chart, or null if there is no image.
int getBackgroundImageAlignment()
Returns the background image alignment.
float getBackgroundImageAlpha()
Returns the alpha-transparency for the chart's background image.
Paint getBackgroundPaint()
Returns the paint used for the chart background.
Paint getBorderPaint()
Returns the paint used to draw the chart border (if visible).
Stroke getBorderStroke()
Returns the stroke used to draw the chart border (if visible).
CategoryPlot getCategoryPlot()
Returns the plot cast as a CategoryPlot .
LegendTitle getLegend()
Returns the legend for the chart, if there is one.
LegendTitle getLegend( int index )
Returns the nth legend for a chart, or null.
RectangleInsets getPadding()
Returns the padding between the chart border and the chart drawing area.
Plot getPlot()
Returns the plot for the chart.
RenderingHints getRenderingHints()
Returns the collection of rendering hints for the chart.
Title getSubtitle( int index )
Returns a chart subtitle.
int getSubtitleCount()
Returns the number of titles for the chart.
List getSubtitles()
Returns the list of subtitles for the chart.
TextTitle getTitle()
Returns the main chart title.
XYPlot getXYPlot()
Returns the plot cast as an XYPlot .
void handleClick( int x, int y, ChartRenderingInfo info )
Handles a 'click' on the chart.
boolean isBorderVisible()
Returns a flag that controls whether or not a border is drawn around the outside of the chart.
boolean isNotify()
Returns a flag that controls whether or not change events are sent to registered listeners.
static void main( String [] args )
Prints information about JFreeChart to standard output.
protected void notifyListeners( ChartChangeEvent event )
Sends a ChartChangeEvent to all registered listeners.
protected void notifyListeners( ChartProgressEvent event )
Sends a ChartProgressEvent to all registered listeners.
void plotChanged( PlotChangeEvent event )
Receives notification that the plot has changed, and passes this on to registered listeners.
void removeChangeListener( ChartChangeListener listener )
Deregisters an object for notification of changes to the chart.
void removeLegend()
Removes the first legend in the chart and sends a ChartChangeEvent to all registered listeners.
void removeProgressListener( ChartProgressListener listener )
Deregisters an object for notification of changes to the chart.
void removeSubtitle( Title title )
Removes the specified subtitle and sends a ChartChangeEvent to all registered listeners.
void setAntiAlias( boolean flag )
Sets a flag that indicates whether or not anti-aliasing is used when the chart is drawn.
void setBackgroundImage( Image image )
Sets the background image for the chart and sends a ChartChangeEvent to all registered listeners.
void setBackgroundImageAlignment( int alignment )
Sets the background alignment.
void setBackgroundImageAlpha( float alpha )
Sets the alpha-transparency for the chart's background image.
void setBackgroundPaint( Paint paint )
Sets the paint used to fill the chart background and sends a ChartChangeEvent to all registered listeners.
void setBorderPaint( Paint paint )
Sets the paint used to draw the chart border (if visible).
void setBorderStroke( Stroke stroke )
Sets the stroke used to draw the chart border (if visible).
void setBorderVisible( boolean visible )
Sets a flag that controls whether or not a border is drawn around the outside of the chart.
void setNotify( boolean notify )
Sets a flag that controls whether or not listeners receive ChartChangeEvent notifications.
void setPadding( RectangleInsets padding )
Sets the padding between the chart border and the chart drawing area, and sends a ChartChangeEvent to all registered listeners.
void setRenderingHints( RenderingHints renderingHints )
Sets the rendering hints for the chart.
void setSubtitles( List subtitles )
Sets the title list for the chart (completely replaces any existing titles).
void setTitle( TextTitle title )
Sets the main title for the chart and sends a ChartChangeEvent to all registered listeners.
void setTitle( String text )
Sets the chart title and sends a ChartChangeEvent to all registered listeners.
void titleChanged( TitleChangeEvent event )
Receives notification that a chart title has changed, and passes this on to registered listeners.
DEFAULT_BACKGROUND_IMAGE
public static Image DEFAULT_BACKGROUND_IMAGE
The default background image.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_BACKGROUND_IMAGE_ALIGNMENT
public static int DEFAULT_BACKGROUND_IMAGE_ALIGNMENT
The default background image alignment.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_BACKGROUND_IMAGE_ALPHA
public static float DEFAULT_BACKGROUND_IMAGE_ALPHA
The default background image alpha.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_BACKGROUND_PAINT
public static Paint DEFAULT_BACKGROUND_PAINT
The default background color.
Wiki javadoc Use textile entry format.
Add your comments here.
DEFAULT_TITLE_FONT
public static Font DEFAULT_TITLE_FONT
The default font for titles.
Wiki javadoc Use textile entry format.
Add your comments here.
INFO
public static ProjectInfo INFO
Information about the project.
Wiki javadoc Use textile entry format.
Add your comments here.
JFreeChart
public JFreeChart ( Plot plot )
Creates a new chart based on the supplied plot. The chart will have a legend added automatically, but no title (although you can easily add one later).

Note that the ChartFactory class contains a range of static methods that will return ready-made charts, and often this is a more convenient way to create charts than using this constructor.
Parameters
TypeNameDescription
Plot plot the plot (null not permitted).
Wiki javadoc Use textile entry format.
Add your comments here.
JFreeChart
public JFreeChart ( String title, Plot plot )
Creates a new chart with the given title and plot. A default font (@link DEFAULT_TITLE_FONT) is used for the title, and the chart will have a legend added automatically.

Note that the ChartFactory class contains a range of static methods that will return ready-made charts, and often this is a more convenient way to create charts than using this constructor.
Parameters
TypeNameDescription
String title the chart title (null permitted).
Plot plot the plot (null not permitted).
Wiki javadoc Use textile entry format.
Add your comments here.
JFreeChart
public JFreeChart ( String title, Font titleFont, Plot plot, boolean createLegend )
Creates a new chart with the given title and plot. The createLegend argument specifies whether or not a legend should be added to the chart.

Note that the ChartFactory class contains a range of static methods that will return ready-made charts, and often this is a more convenient way to create charts than using this constructor.
Parameters
TypeNameDescription
String title the chart title (null permitted).
Font titleFont the font for displaying the chart title (null permitted).
Plot plot controller of the visual representation of the data (null not permitted).
boolean createLegend a flag indicating whether or not a legend should be created for the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
addChangeListener
public void addChangeListener ( ChartChangeListener listener )
Registers an object for notification of changes to the chart.
Parameters
TypeNameDescription
ChartChangeListener listener the listener (null not permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
addLegend
public void addLegend ( LegendTitle legend )
Adds a legend to the plot and sends a ChartChangeEvent to all registered listeners.
Parameters
TypeNameDescription
LegendTitle legend the legend (null not permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
addProgressListener
public void addProgressListener ( ChartProgressListener listener )
Registers an object for notification of progress events relating to the chart.
Parameters
TypeNameDescription
ChartProgressListener listener the object being registered.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
addSubtitle
public void addSubtitle ( Title subtitle )
Adds a chart subtitle, and notifies registered listeners that the chart has been modified.
Parameters
TypeNameDescription
Title subtitle the subtitle (null not permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
clearSubtitles
public void clearSubtitles ( )
Clears all subtitles from the chart and sends a ChartChangeEvent to all registered listeners.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
clone
public Object clone ( )
Clones the object, and takes care of listeners. Note: caller shall register its own listeners on cloned graph.
Overrides method in Object
Exceptions
CloneNotSupportedException if the chart is not cloneable.
Wiki javadoc Use textile entry format.
Add your comments here.
createBufferedImage
public BufferedImage createBufferedImage ( int width, int height )
Creates and returns a buffered image into which the chart has been drawn.
Parameters
TypeNameDescription
int width the width.
int height the height.
Wiki javadoc Use textile entry format.
Add your comments here.
createBufferedImage
public BufferedImage createBufferedImage ( int width, int height, ChartRenderingInfo info )
Creates and returns a buffered image into which the chart has been drawn.
Parameters
TypeNameDescription
int width the width.
int height the height.
ChartRenderingInfo info carries back chart state information (null permitted).
Wiki javadoc Use textile entry format.
Add your comments here.
createBufferedImage
public BufferedImage createBufferedImage ( int width, int height, int imageType, ChartRenderingInfo info )
Creates and returns a buffered image into which the chart has been drawn.
Parameters
TypeNameDescription
int width the width.
int height the height.
int imageType the image type.
ChartRenderingInfo info carries back chart state information (null permitted).
Wiki javadoc Use textile entry format.
Add your comments here.
createBufferedImage
public BufferedImage createBufferedImage ( int imageWidth, int imageHeight, double drawWidth, double drawHeight, ChartRenderingInfo info )
Creates and returns a buffered image into which the chart has been drawn.
Parameters
TypeNameDescription
int imageWidth the image width.
int imageHeight the image height.
double drawWidth the width for drawing the chart (will be scaled to fit image).
double drawHeight the height for drawing the chart (will be scaled to fit image).
ChartRenderingInfo info optional object for collection chart dimension and entity information.
Wiki javadoc Use textile entry format.
Add your comments here.
draw
public void draw ( Graphics2D g2, Rectangle2D area )
Draws the chart on a Java 2D graphics device (such as the screen or a printer).

This method is the focus of the entire JFreeChart library.

Implements method in Drawable
Parameters
TypeNameDescription
Graphics2D g2 the graphics device.
Rectangle2D area the area within which the chart should be drawn.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
draw
public void draw ( Graphics2D g2, Rectangle2D area, ChartRenderingInfo info )
Draws the chart on a Java 2D graphics device (such as the screen or a printer). This method is the focus of the entire JFreeChart library.
Parameters
TypeNameDescription
Graphics2D g2 the graphics device.
Rectangle2D area the area within which the chart should be drawn.
ChartRenderingInfo info records info about the drawing (null means collect no info).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
draw
public void draw ( Graphics2D g2, Rectangle2D chartArea, Point2D anchor, ChartRenderingInfo info )
Draws the chart on a Java 2D graphics device (such as the screen or a printer).

This method is the focus of the entire JFreeChart library.

Parameters
TypeNameDescription
Graphics2D g2 the graphics device.
Rectangle2D chartArea the area within which the chart should be drawn.
Point2D anchor the anchor point (in Java2D space) for the chart (null permitted).
ChartRenderingInfo info records info about the drawing (null means collect no info).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
drawTitle
protected EntityCollection drawTitle ( Title t, Graphics2D g2, Rectangle2D area, boolean entities )
Draws a title. The title should be drawn at the top, bottom, left or right of the specified area, and the area should be updated to reflect the amount of space used by the title.
Parameters
TypeNameDescription
Title t the title (null not permitted).
Graphics2D g2 the graphics device (null not permitted).
Rectangle2D area the chart area, excluding any existing titles (null not permitted).
boolean entities a flag that controls whether or not an entity collection is returned for the title.
Wiki javadoc Use textile entry format.
Add your comments here.
equals
public boolean equals ( Object obj )
Tests this chart for equality with another object.
Overrides method in Object
Parameters
TypeNameDescription
Object obj the object (null permitted).
Wiki javadoc Use textile entry format.
Add your comments here.
fireChartChanged
public void fireChartChanged ( )
Sends a default ChartChangeEvent to all registered listeners.

This method is for convenience only.

Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getAntiAlias
public boolean getAntiAlias ( )
Returns a flag that indicates whether or not anti-aliasing is used when the chart is drawn.
Wiki javadoc Use textile entry format.
Add your comments here.
getBackgroundImage
public Image getBackgroundImage ( )
Returns the background image for the chart, or null if there is no image.
Wiki javadoc Use textile entry format.
Add your comments here.
getBackgroundImageAlignment
public int getBackgroundImageAlignment ( )
Returns the background image alignment. Alignment constants are defined in the org.jfree.ui.Align class in the JCommon class library.
Wiki javadoc Use textile entry format.
Add your comments here.
getBackgroundImageAlpha
public float getBackgroundImageAlpha ( )
Returns the alpha-transparency for the chart's background image.
Wiki javadoc Use textile entry format.
Add your comments here.
getBackgroundPaint
public Paint getBackgroundPaint ( )
Returns the paint used for the chart background.
Wiki javadoc Use textile entry format.
Add your comments here.
getBorderPaint
public Paint getBorderPaint ( )
Returns the paint used to draw the chart border (if visible).
Wiki javadoc Use textile entry format.
Add your comments here.
getBorderStroke
public Stroke getBorderStroke ( )
Returns the stroke used to draw the chart border (if visible).
Wiki javadoc Use textile entry format.
Add your comments here.
getCategoryPlot
public CategoryPlot getCategoryPlot ( )
Returns the plot cast as a CategoryPlot .

NOTE: if the plot is not an instance of CategoryPlot , then a ClassCastException is thrown.

Wiki javadoc Use textile entry format.
Add your comments here.
getLegend
public LegendTitle getLegend ( )
Returns the legend for the chart, if there is one. Note that a chart can have more than one legend - this method returns the first.
Wiki javadoc Use textile entry format.
Add your comments here.
getLegend
public LegendTitle getLegend ( int index )
Returns the nth legend for a chart, or null.
Parameters
TypeNameDescription
int index the legend index (zero-based).
Wiki javadoc Use textile entry format.
Add your comments here.
getPadding
public RectangleInsets getPadding ( )
Returns the padding between the chart border and the chart drawing area.
Wiki javadoc Use textile entry format.
Add your comments here.
getPlot
public Plot getPlot ( )
Returns the plot for the chart. The plot is a class responsible for coordinating the visual representation of the data, including the axes (if any).
Wiki javadoc Use textile entry format.
Add your comments here.
getRenderingHints
public RenderingHints getRenderingHints ( )
Returns the collection of rendering hints for the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
getSubtitle
public Title getSubtitle ( int index )
Returns a chart subtitle.
Parameters
TypeNameDescription
int index the index of the chart subtitle (zero based).
Wiki javadoc Use textile entry format.
Add your comments here.
getSubtitleCount
public int getSubtitleCount ( )
Returns the number of titles for the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
getSubtitles
public List getSubtitles ( )
Returns the list of subtitles for the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
getTitle
public TextTitle getTitle ( )
Returns the main chart title. Very often a chart will have just one title, so we make this case simple by providing accessor methods for the main title. However, multiple titles are supported - see the addSubtitle(Title) method.
Wiki javadoc Use textile entry format.
Add your comments here.
getXYPlot
public XYPlot getXYPlot ( )
Returns the plot cast as an XYPlot .

NOTE: if the plot is not an instance of XYPlot , then a ClassCastException is thrown.

Wiki javadoc Use textile entry format.
Add your comments here.
handleClick
public void handleClick ( int x, int y, ChartRenderingInfo info )
Handles a 'click' on the chart.

JFreeChart is not a UI component, so some other object (e.g. ChartPanel) needs to capture the click event and pass it onto the JFreeChart object. If you are not using JFreeChart in a client application, then this method is not required (and hopefully it doesn't get in the way).

Parameters
TypeNameDescription
int x x-coordinate of the click (in Java2D space).
int y y-coordinate of the click (in Java2D space).
ChartRenderingInfo info contains chart dimension and entity information.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
isBorderVisible
public boolean isBorderVisible ( )
Returns a flag that controls whether or not a border is drawn around the outside of the chart.
Wiki javadoc Use textile entry format.
Add your comments here.
isNotify
public boolean isNotify ( )
Returns a flag that controls whether or not change events are sent to registered listeners.
Wiki javadoc Use textile entry format.
Add your comments here.
main
public static void main ( String [] args )
Prints information about JFreeChart to standard output.
Parameters
TypeNameDescription
String [] args no arguments are honored.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
notifyListeners
protected void notifyListeners ( ChartChangeEvent event )
Sends a ChartChangeEvent to all registered listeners.
Parameters
TypeNameDescription
ChartChangeEvent event information about the event that triggered the notification.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
notifyListeners
protected void notifyListeners ( ChartProgressEvent event )
Sends a ChartProgressEvent to all registered listeners.
Parameters
TypeNameDescription
ChartProgressEvent event information about the event that triggered the notification.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
plotChanged
public void plotChanged ( PlotChangeEvent event )
Receives notification that the plot has changed, and passes this on to registered listeners.
Implements method in PlotChangeListener
Parameters
TypeNameDescription
PlotChangeEvent event information about the plot change.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeChangeListener
public void removeChangeListener ( ChartChangeListener listener )
Deregisters an object for notification of changes to the chart.
Parameters
TypeNameDescription
ChartChangeListener listener the listener (null not permitted)
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeLegend
public void removeLegend ( )
Removes the first legend in the chart and sends a ChartChangeEvent to all registered listeners.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeProgressListener
public void removeProgressListener ( ChartProgressListener listener )
Deregisters an object for notification of changes to the chart.
Parameters
TypeNameDescription
ChartProgressListener listener the object being deregistered.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
removeSubtitle
public void removeSubtitle ( Title title )
Removes the specified subtitle and sends a ChartChangeEvent to all registered listeners.
Parameters
TypeNameDescription
Title title the title.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setAntiAlias
public void setAntiAlias ( boolean flag )
Sets a flag that indicates whether or not anti-aliasing is used when the chart is drawn.

Anti-aliasing usually improves the appearance of charts, but is slower.

Parameters
TypeNameDescription
boolean flag the new value of the flag.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setBackgroundImage
public void setBackgroundImage ( Image image )
Sets the background image for the chart and sends a ChartChangeEvent to all registered listeners.
Parameters
TypeNameDescription
Image image the image (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setBackgroundImageAlignment
public void setBackgroundImageAlignment ( int alignment )
Sets the background alignment. Alignment options are defined by the Align class.
Parameters
TypeNameDescription
int alignment the alignment.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setBackgroundImageAlpha
public void setBackgroundImageAlpha ( float alpha )
Sets the alpha-transparency for the chart's background image. Registered listeners are notified that the chart has been changed.
Parameters
TypeNameDescription
float alpha the alpha value.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setBackgroundPaint
public void setBackgroundPaint ( Paint paint )
Sets the paint used to fill the chart background and sends a ChartChangeEvent to all registered listeners.
Parameters
TypeNameDescription
Paint paint the paint (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setBorderPaint
public void setBorderPaint ( Paint paint )
Sets the paint used to draw the chart border (if visible).
Parameters
TypeNameDescription
Paint paint the paint.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setBorderStroke
public void setBorderStroke ( Stroke stroke )
Sets the stroke used to draw the chart border (if visible).
Parameters
TypeNameDescription
Stroke stroke the stroke.
Returns void No description provided.
Wiki javadoc Use textile entry format.

srhsrty

setBorderVisible
public void setBorderVisible ( boolean visible )
Sets a flag that controls whether or not a border is drawn around the outside of the chart.
Parameters
TypeNameDescription
boolean visible the flag.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setNotify
public void setNotify ( boolean notify )
Sets a flag that controls whether or not listeners receive ChartChangeEvent notifications.
Parameters
TypeNameDescription
boolean notify a boolean.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setPadding
public void setPadding ( RectangleInsets padding )
Sets the padding between the chart border and the chart drawing area, and sends a ChartChangeEvent to all registered listeners.
Parameters
TypeNameDescription
RectangleInsets padding the padding (null not permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setRenderingHints
public void setRenderingHints ( RenderingHints renderingHints )
Sets the rendering hints for the chart. These will be added (using the Graphics2D.addRenderingHints() method) near the start of the JFreeChart.draw() method.
Parameters
TypeNameDescription
RenderingHints renderingHints the rendering hints (null not permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setSubtitles
public void setSubtitles ( List subtitles )
Sets the title list for the chart (completely replaces any existing titles).
Parameters
TypeNameDescription
List subtitles the new list of subtitles (null not permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setTitle
public void setTitle ( TextTitle title )
Sets the main title for the chart and sends a ChartChangeEvent to all registered listeners. If you do not want a title for the chart, set it to null. If you want more than one title on a chart, use the addSubtitle(Title) method.
Parameters
TypeNameDescription
TextTitle title the title (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
setTitle
public void setTitle ( String text )
Sets the chart title and sends a ChartChangeEvent to all registered listeners. This is a convenience method that ends up calling the setTitle(TextTitle) method. If there is an existing title, its text is updated, otherwise a new title using the default font is added to the chart. If text is null the chart title is set to null.
Parameters
TypeNameDescription
String text the title text (null permitted).
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
titleChanged
public void titleChanged ( TitleChangeEvent event )
Receives notification that a chart title has changed, and passes this on to registered listeners.
Implements method in TitleChangeListener
Parameters
TypeNameDescription
TitleChangeEvent event information about the chart title change.
Returns void No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.