The Chart object represents a single chart.

#### Creating and initializing a new SwiffChart object

Creating a new SwiffChart object requires some preliminary initializations. These requirements are detailed in the article Using Swiff Chart Generator in JSP pages. Read this article carefully before using the methods defined in the API.

#### Using the Chart object

The chart object is created through the class named SwiffChart defined in the java package com.globfx.swiffchart. This package is available in the JAR archive SwiffChart.jar installed with Swiff Chart Generator. See Using Swiff Chart Generator in JSP pages for more information about SwiffChart.jar.

When a Chart object is first created, it is empty (it does not contain any series, categories, etc). Use the methods described in the table below for filling a chart object with data, setting the graphical layout of a chart object and generating a chart image from a chart object.

Method | Definition
--- | ---
SetDocumentRoot SetServletInfo | Use these methods to initialize the SwiffChart object.
SetSeriesValuesFromArray SetSeriesValuesFromString | Use these methods to fill a series with data values.
SetSeriesXValuesFromArray SetSeriesYValuesFromArray SetSeriesXValuesFromString SetSeriesYValuesFromString | Use these methods to fill a series with XY values.
SetSeriesCaption SetSeriesCaptionsFromArray SetSeriesCaptionsFromString | Use these methods to specify the series captions.
SetCategoriesFromArray SetCategoriesFromString | Use these methods to set the categories of a chart object.
SetDataFromTxtFile | Use this method to set the series, categories, title, etc. all together.
LoadStyle | Use this method to set the graphical layout of a chart object. This method takes a Swiff Chart style file as parameter (.scs).
SetOutputFormat | Use this method to specify the format of the generated chart (Flash movie, JPG or PNG image, SVG or PDF document).
ExportAsResponse ExportAsFile ExportAsBinary GetHTMLTag GetOutputLocation | Use these methods to generate the chart in Flash format (.swf), in PNG or JPG image format (.png, .jpg), in SVG or PDF document format (.svg, .pdf).

#### See Also

GetVersion Method