OFC Charts 3.1


com.oxymel.ofc.charts
Class Chart

java.lang.Object
  |
  +--com.oxymel.ofc.charts.Chart
Direct Known Subclasses:
ChartWithAxisXY, DialChart, ExplodedPieChart, GaugeChart, PieChart

public abstract class Chart
extends java.lang.Object

This abstract class is the superclass of all classes implementing graphics. It provides a set of methods allowing to draw charts in different resulting formats, such as SVG or JPEG for instance. The resulting drawn chart can be stored in a file or an OutputStream, or returned as a string.


Field Summary
static int ROTATE_180_DEGREE
          A 180 degrees rotation is applied to the graphic
static int ROTATE_270_DEGREE
          A 270 degrees rotation is applied to the graphic
static int ROTATE_90_DEGREE
          A 90 degrees rotation is applied to the graphic
static int ROTATE_NONE
          Default rotation value, no rotation is applied to the graphic
 
Method Summary
 void drawAnimateSVG(java.io.OutputStream out, SVGAnimationContext svgAnimationContext)
          Draws an animated chart and produces the result as an OutputStream
 void drawAnimateSVG(java.io.OutputStream out, SVGAnimationContext svgAnimationContext, SVGContext svgContext)
          Draws an animated chart within a given SVG context and produces the result as an OutputStream
 void drawAnimateSVG(java.lang.String pathFileName, SVGAnimationContext svgAnimationContext)
          Draws an animated chart and produces the result as a SVG file
 void drawAnimateSVG(java.lang.String pathFileName, SVGAnimationContext svgAnimationContext, SVGContext svgContext)
          Draws an animated chart within a given SGV context and produces the result as a SVG file
 java.lang.String drawAnimateSVG(SVGAnimationContext svgAnimationContext)
          Draws an animated chart and return the SVG as a String
 void drawJPEG(java.io.OutputStream out)
          Draws a chart and produce a JPEG result in an OutputStream
 void drawJPEG(java.lang.String pathFileName)
          Draws a chart and produce a JPEG result in a file
 void drawPNG(java.io.OutputStream out)
          Draws a chart and produce a PNG result in an OutputStream
 void drawPNG(java.lang.String pathFileName)
          Draws a chart and produce a PNG result in a file
 java.lang.String drawSVG()
          Draws a chart and returns the SVG as a String
 void drawSVG(java.io.OutputStream out)
          Draws a chart and produces the result as a SVG stored in an OuputStream
 void drawSVG(java.io.OutputStream out, SVGContext svgContext)
          Draws a chart within a given SVG context and produces the result as a SVGstored in an OuputStream
 void drawSVG(java.lang.String pathFileName)
          Draws a chart and produces the result as a SVG file
 void drawSVG(java.lang.String pathFileName, SVGContext svgContext)
          Draws a chart within a given SVG context and produces the result as a SVG file
 java.lang.String drawSVG(SVGContext svgContext)
          Draws a chart within a given SVG context and returns the SVG as a String
 int get3dEffectValue()
          Get the 3d effect value previously set (default value is 0)
 java.util.Vector getAllSeriesOrderByDisplayNumber()
          Get a Vector containing all the Series (data) defining the chart.
 java.awt.image.BufferedImage getBufferedImage()
          Get buffered image
 void set3dEffectValue(int coeff3dEffect)
          Sets the 3d effect value.
 void setBackgroundColorVisible(boolean isBackGroundColorVisible)
          Sets the background color visibility according to the parameter value.
 void setColorPalette(ColorPalette colorPalette)
          Sets color Palette.
 void setGraphicBackgroundColor(java.awt.Color color)
          Sets the graphic background color
 void setImageBackgroundColor(java.awt.Color color)
          Sets the image background color
 void setLegendAlignMode(int legendAlignMode)
          Sets the legend align mode
 void setLegendDisplayMode(int legendDisplayMode)
          Sets the legend display mode.
 void setLegendFontSize(int size)
          Sets font size to be used for the legend
 void setNbPixelFreeArroundImageForPresentation(int _nbPixelFreeArroundImageForPresentation)
          Sets the number of pixels between the plot area and the edge of the image.
 void setRotateValue(int rotationValue)
          Sets a rotation value for the chart.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROTATE_NONE

public static final int ROTATE_NONE
Default rotation value, no rotation is applied to the graphic

ROTATE_90_DEGREE

public static final int ROTATE_90_DEGREE
A 90 degrees rotation is applied to the graphic

ROTATE_180_DEGREE

public static final int ROTATE_180_DEGREE
A 180 degrees rotation is applied to the graphic

ROTATE_270_DEGREE

public static final int ROTATE_270_DEGREE
A 270 degrees rotation is applied to the graphic
Method Detail

setBackgroundColorVisible

public void setBackgroundColorVisible(boolean isBackGroundColorVisible)
Sets the background color visibility according to the parameter value.
Parameters:
isBackGroundColorVisible - If true the background color is visible

get3dEffectValue

public int get3dEffectValue()
Get the 3d effect value previously set (default value is 0)
Returns:
3d effect value

set3dEffectValue

public void set3dEffectValue(int coeff3dEffect)
Sets the 3d effect value. The default value is 0 it corresponds to a 2D presentation. As an exemple, for a bar chart this value is used to compute the depth of the bars.
Parameters:
coeff3dEffect - 3d effect value to be set, a positive int value

setImageBackgroundColor

public void setImageBackgroundColor(java.awt.Color color)
Sets the image background color
Parameters:
color - The image background color to be set

setGraphicBackgroundColor

public void setGraphicBackgroundColor(java.awt.Color color)
Sets the graphic background color
Parameters:
color - The graphic background color to be set

setLegendFontSize

public void setLegendFontSize(int size)
Sets font size to be used for the legend
Parameters:
size - The legend font size to be set

setRotateValue

public void setRotateValue(int rotationValue)
Sets a rotation value for the chart.
Parameters:
rotationValue - Values allowed for the rotation value are:
  • ROTATE_NONE: no rotation (default value)
  • ROTATE_90_DEGREE: 90 degrees rotation
  • ROTATE_180_DEGREE: 180 degrees rotation
  • ROTATE_270_DEGREE: 270 degrees rotation

  • any other value is replaced by the default value.

    drawPNG

    public void drawPNG(java.lang.String pathFileName)
                 throws OFCChartsException
    Draws a chart and produce a PNG result in a file
    Parameters:
    pathFileName - Resulting file name to store the generated JPEG
    Throws:
    OFCChartsException -  

    drawPNG

    public void drawPNG(java.io.OutputStream out)
                 throws OFCChartsException
    Draws a chart and produce a PNG result in an OutputStream
    Parameters:
    out - OutputStream The Output Stream to write chart
    Throws:
    OFCChartsException -  

    drawJPEG

    public void drawJPEG(java.lang.String pathFileName)
                  throws OFCChartsException
    Draws a chart and produce a JPEG result in a file
    Parameters:
    pathFileName - Resulting file name to store the generated JPEG
    Throws:
    OFCChartsException -  

    drawJPEG

    public void drawJPEG(java.io.OutputStream out)
                  throws OFCChartsException
    Draws a chart and produce a JPEG result in an OutputStream
    Parameters:
    out - OutputStream The Output Stream to write chart
    Throws:
    OFCChartsException -  

    setColorPalette

    public void setColorPalette(ColorPalette colorPalette)
    Sets color Palette. This Palette replaces the default one.
    Parameters:
    colorPalette - Palette of colors to be set

    getBufferedImage

    public java.awt.image.BufferedImage getBufferedImage()
                                                  throws OFCChartsException
    Get buffered image
    Returns:
    Buffered image of chart
    Throws:
    OFCChartsException -  

    drawSVG

    public void drawSVG(java.lang.String pathFileName)
                 throws OFCChartsException
    Draws a chart and produces the result as a SVG file
    Parameters:
    pathFileName - Resulting file name to store the generated SVG
    Throws:
    OFCChartsException -  

    drawSVG

    public void drawSVG(java.lang.String pathFileName,
                        SVGContext svgContext)
                 throws OFCChartsException
    Draws a chart within a given SVG context and produces the result as a SVG file
    Parameters:
    pathFileName - Resulting file name to store the generated SVG
    svgContext - Contains information defining the SVG context
    Throws:
    OFCChartsException -  

    drawSVG

    public void drawSVG(java.io.OutputStream out)
                 throws OFCChartsException
    Draws a chart and produces the result as a SVG stored in an OuputStream
    Parameters:
    out - OutputStream The OutputStream to write chart
    Throws:
    OFCChartsException -  

    drawSVG

    public void drawSVG(java.io.OutputStream out,
                        SVGContext svgContext)
                 throws OFCChartsException
    Draws a chart within a given SVG context and produces the result as a SVGstored in an OuputStream
    Parameters:
    out - OutputStream The OutputStream to write chart
    svgContext - Contains information defining the SVG context
    Throws:
    OFCChartsException -  

    drawSVG

    public java.lang.String drawSVG()
                             throws OFCChartsException
    Draws a chart and returns the SVG as a String
    Returns:
    String It contains the SVG result
    Throws:
    OFCChartsException -  

    drawSVG

    public java.lang.String drawSVG(SVGContext svgContext)
                             throws OFCChartsException
    Draws a chart within a given SVG context and returns the SVG as a String
    Parameters:
    svgContext - Contains information defining the SVG context
    Returns:
    String It contains the SVG result
    Throws:
    OFCChartsException -  

    drawAnimateSVG

    public void drawAnimateSVG(java.lang.String pathFileName,
                               SVGAnimationContext svgAnimationContext)
                        throws OFCChartsException
    Draws an animated chart and produces the result as a SVG file
    Parameters:
    pathFileName - Resulting file name to store the generated SVG
    svgAnimationContext - Contains the information related to the animation
    Throws:
    OFCChartsException -  

    drawAnimateSVG

    public void drawAnimateSVG(java.lang.String pathFileName,
                               SVGAnimationContext svgAnimationContext,
                               SVGContext svgContext)
                        throws OFCChartsException
    Draws an animated chart within a given SGV context and produces the result as a SVG file
    Parameters:
    pathFileName - Resulting file name to store the generated SVG
    svgAnimationContext - Contains the information related to the animation
    svgContext - Contains information defining the SVG context
    Throws:
    OFCChartsException -  

    drawAnimateSVG

    public void drawAnimateSVG(java.io.OutputStream out,
                               SVGAnimationContext svgAnimationContext)
                        throws OFCChartsException
    Draws an animated chart and produces the result as an OutputStream
    Parameters:
    out - OutputStream The OutputStream to write the chart
    svgAnimationContext - Contains the information related to the animation
    Throws:
    OFCChartsException -  

    drawAnimateSVG

    public void drawAnimateSVG(java.io.OutputStream out,
                               SVGAnimationContext svgAnimationContext,
                               SVGContext svgContext)
                        throws OFCChartsException
    Draws an animated chart within a given SVG context and produces the result as an OutputStream
    Parameters:
    out - The OutputStream to write the chart
    svgAnimationContext - Contains the information related to the animation
    svgContext - Contains information defining the SVG context
    Throws:
    OFCChartsException -  

    drawAnimateSVG

    public java.lang.String drawAnimateSVG(SVGAnimationContext svgAnimationContext)
                                    throws OFCChartsException
    Draws an animated chart and return the SVG as a String
    Parameters:
    svgAnimationContext - Contains the information related to the animation
    Returns:
    String contains the SVG chart
    Throws:
    OFCChartsException -  

    getAllSeriesOrderByDisplayNumber

    public java.util.Vector getAllSeriesOrderByDisplayNumber()
    Get a Vector containing all the Series (data) defining the chart. The order in the Vector reflects the order in which the Series have been added. The real class of the series depends on the chart subclass implied.
    Returns:
    Vector which contains all series

    setLegendDisplayMode

    public void setLegendDisplayMode(int legendDisplayMode)
    Sets the legend display mode.
    Restriction: The legend couldn't look like a table.
    Parameters:
    legendDisplayMode - The legend display mode to set.
    See Also:
    Legend

    setLegendAlignMode

    public void setLegendAlignMode(int legendAlignMode)
    Sets the legend align mode
    Parameters:
    legendAlignMode - The legend align mode to set.
    See Also:
    Legend

    setNbPixelFreeArroundImageForPresentation

    public void setNbPixelFreeArroundImageForPresentation(int _nbPixelFreeArroundImageForPresentation)
    Sets the number of pixels between the plot area and the edge of the image. The defaults value is 5 pixels
    Parameters:
    _nbPixelFreeArroundImageForPresentation - int : number of pixels

    OFC Charts 3.1


    Copyright © 2005 Oxymel SA All Rights Reserved.