Method Summary |
|
public void | addChangeListener(ChartChangeListener listener) Registers an object for notification of changes to the chart. |
public void | addLegend(LegendTitle legend) Adds a legend to the plot and sends a
ChartChangeEvent to all
registered listeners. |
public void | addProgressListener(ChartProgressListener listener) Registers an object for notification of progress events relating to the
chart. |
public void | addSubtitle(Title subtitle) Adds a chart subtitle, and notifies registered listeners that the chart
has been modified. |
public void | addSubtitle(int index, Title subtitle) Adds a subtitle at a particular position in the subtitle list, and sends
a
ChartChangeEvent to all registered listeners. |
public void | clearSubtitles() Clears all subtitles from the chart and sends a
ChartChangeEvent to all registered listeners. |
public Object | clone() Clones the object, and takes care of listeners. |
public BufferedImage | createBufferedImage(int width, int height) Creates and returns a buffered image into which the chart has been drawn.
Parameters: width - the width. Parameters: height - the height. |
public BufferedImage | createBufferedImage(int width, int height, ChartRenderingInfo info) Creates and returns a buffered image into which the chart has been drawn.
Parameters: width - the width. Parameters: height - the height. Parameters: info - carries back chart state information (null permitted). |
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: width - the width. Parameters: height - the height. Parameters: imageType - the image type. Parameters: info - carries back chart state information (null permitted). |
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: imageWidth - the image width. Parameters: imageHeight - the image height. Parameters: drawWidth - the width for drawing the chart (will be scaled to fit image). Parameters: drawHeight - the height for drawing the chart (will be scaled to fit image). Parameters: info - optional object for collection chart dimension and entity information. |
public void | draw(Graphics2D g2, Rectangle2D area) Draws the chart on a Java 2D graphics device (such as the screen or a
printer). |
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). |
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). |
protected EntityCollection | drawTitle(Title t, Graphics2D g2, Rectangle2D area, boolean entities) Draws a title. |
public boolean | equals(Object obj) Tests this chart for equality with another object.
Parameters: obj - the object (null permitted). |
public void | fireChartChanged() Sends a default
ChartChangeEvent to all registered listeners. |
public boolean | getAntiAlias() Returns a flag that indicates whether or not anti-aliasing is used when
the chart is drawn. |
public Image | getBackgroundImage() Returns the background image for the chart, or null if
there is no image. |
public int | getBackgroundImageAlignment() Returns the background image alignment. |
public float | getBackgroundImageAlpha() Returns the alpha-transparency for the chart's background image. |
public Paint | getBackgroundPaint() Returns the paint used for the chart background. |
public Paint | getBorderPaint() Returns the paint used to draw the chart border (if visible). |
public Stroke | getBorderStroke() Returns the stroke used to draw the chart border (if visible). |
public CategoryPlot | getCategoryPlot() Returns the plot cast as a
CategoryPlot . |
public LegendTitle | getLegend() Returns the legend for the chart, if there is one. |
public LegendTitle | getLegend(int index) Returns the nth legend for a chart, or null .
Parameters: index - the legend index (zero-based). |
public RectangleInsets | getPadding() Returns the padding between the chart border and the chart drawing area. |
public Plot | getPlot() Returns the plot for the chart. |
public RenderingHints | getRenderingHints() Returns the collection of rendering hints for the chart. |
public Title | getSubtitle(int index) Returns a chart subtitle.
Parameters: index - the index of the chart subtitle (zero based). |
public int | getSubtitleCount() Returns the number of titles for the chart. |
public List | getSubtitles() Returns the list of subtitles for the chart. |
public Object | getTextAntiAlias() Returns the current value stored in the rendering hints table for
RenderingHints.KEY_TEXT_ANTIALIASING . |
public TextTitle | getTitle() Returns the main chart title. |
public XYPlot | getXYPlot() Returns the plot cast as an
XYPlot . |
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. |
public boolean | isBorderVisible() Returns a flag that controls whether or not a border is drawn around the
outside of the chart. |
public boolean | isNotify() Returns a flag that controls whether or not change events are sent to
registered listeners. |
public 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. |
public void | plotChanged(PlotChangeEvent event) Receives notification that the plot has changed, and passes this on to
registered listeners. |
public void | removeChangeListener(ChartChangeListener listener) Deregisters an object for notification of changes to the chart. |
public void | removeLegend() Removes the first legend in the chart and sends a
ChartChangeEvent to all registered listeners. |
public void | removeProgressListener(ChartProgressListener listener) Deregisters an object for notification of changes to the chart. |
public void | removeSubtitle(Title title) Removes the specified subtitle and sends a
ChartChangeEvent to
all registered listeners. |
public void | setAntiAlias(boolean flag) Sets a flag that indicates whether or not anti-aliasing is used when the
chart is drawn. |
public void | setBackgroundImage(Image image) Sets the background image for the chart and sends a
ChartChangeEvent to all registered listeners. |
public void | setBackgroundImageAlignment(int alignment) Sets the background alignment. |
public void | setBackgroundImageAlpha(float alpha) Sets the alpha-transparency for the chart's background image. |
public void | setBackgroundPaint(Paint paint) Sets the paint used to fill the chart background and sends a
ChartChangeEvent to all registered listeners. |
public void | setBorderPaint(Paint paint) Sets the paint used to draw the chart border (if visible). |
public void | setBorderStroke(Stroke stroke) Sets the stroke used to draw the chart border (if visible). |
public void | setBorderVisible(boolean visible) Sets a flag that controls whether or not a border is drawn around the
outside of the chart. |
public void | setNotify(boolean notify) Sets a flag that controls whether or not listeners receive
ChartChangeEvent notifications. |
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. |
public void | setRenderingHints(RenderingHints renderingHints) Sets the rendering hints for the chart. |
public void | setSubtitles(List subtitles) Sets the title list for the chart (completely replaces any existing
titles) and sends a
ChartChangeEvent to all registered
listeners. |
public void | setTextAntiAlias(boolean flag) Sets the value in the rendering hints table for
RenderingHints.KEY_TEXT_ANTIALIASING to either
RenderingHints.VALUE_TEXT_ANTIALIAS_ON or
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF , then sends a
ChartChangeEvent to all registered listeners. |
public void | setTextAntiAlias(Object val) Sets the value in the rendering hints table for
RenderingHints.KEY_TEXT_ANTIALIASING and sends a
ChartChangeEvent to all registered listeners. |
public void | setTitle(TextTitle title) Sets the main title for the chart and sends a
ChartChangeEvent
to all registered listeners. |
public void | setTitle(String text) Sets the chart title and sends a
ChartChangeEvent to all
registered listeners. |
public void | titleChanged(TitleChangeEvent event) Receives notification that a chart title has changed, and passes this
on to registered listeners. |