The Chart object represents a single chart.

Using the Chart object

The chart object is created through the class named SwiffChart.

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 Flash movie from a chart object.

Method Definition
AddSeries Use this method to add a new empty series to a chart object. This is required before setting the series data values and caption.
SetSeriesValuesFromArray
SetSeriesValuesFromString
Use these methods to fill an existing series with data values. Use the AddSeries method to create a new empty series.
SetSeriesXValuesFromArray
SetSeriesYValuesFromArray
SetSeriesXValuesFromString
SetSeriesYValuesFromString
Use these methods to fill an existing series with XY values. Use the AddSeries method to create a new empty series.
SetSeriesCaption
SetSeriesCaptionsFromArray
SetSeriesCaptionsFromString
Use these methods to specify the series captions.
SetCategoriesFromArray
SetCategoriesFromString
Use these methods to set the categories of a chart object.
SetDataFromQuery
SetDataFromFile
Use these methods 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 these methods to specify the format of the generated chart (Flash movie, JPG image or PNG image).
ExportAsResponse
ExportAsFile
ExportAsBinary
GetHTMLTag
GetOutputLocation
Use these methods to generate the chart in Flash format (.swf), in PNG or JPG image format (.png, .jpg).

PHP Code Sample

The following example creates an object named myChart.

$myChart= new SwiffChart;

See Also

GetVersion Method