The Chart object represents a single chart.
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 chart image from a chart object.
Method | Definition |
---|---|
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. |
SetDataFromQuery SetDataFromTxtFile |
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 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). |
The following example creates an object named myChart.
$myChart= new SwiffChart;