Specifies the output format of the generated chart.

void object->SetOutputFormat( string output_format )

Arguments

object
Required. A Chart object.
output_format
Required. A string that specifies the format of the generated chart.

Remarks

The methods GetOutputLocation, ExportAsResponse, ExportAsFile, ExportAsBinary, GetHTMLTag and GetOutputLocation generate the final chart as an image or a Flash movie. The output format of the generated chart is specified by the SetOutputFormat method.

If not specified, the default output format is "SWF" (i.e. Adobe Flash movie)

The output format is defined by a string value (the output_format parameter) which is interpreted as follows:

Code Definition
"SVG"
SVG Image (Scalable Vector Graphics)
"JPG"
JPEG Image
"PNG"
PNG Image (Portable Network Graphics)
"SWF"
Flash Movie (Adobe Flash)
"PDF"
PDF Document (Adobe Acrobat)

PHP Sample Code

The following PHP code illustrates use of the SetOutputFormat method.

// Create the chart series
$categories= array();
$values= array();

$categories[0] = "Jan";
$categories[1] = "Feb";
$categories[2] = "Mar";

$values[0] = 10;
$values[1] = 20;
$values[2] = 30;

$chart->SetCategoriesFromArray( $categories );

$chart->SetSeriesValuesFromArray( 0, $values );

// Set the chart title
$chart->SetTitle( "My Chart" );

// Set the graphics settings from a style file
$chart->LoadStyle( "C:\\myStyle.scs" );

// The chart is complete, we can now generate the chart as a JPEG image
$chart->SetOutputFormat( "JPG" );
$chart->ExportAsResponse();

See Also

ExportAsResponse Method | ExportAsFile Method | ExportAsBinary Method | GetHTMLTag | GetOutputLocation Method

Applies To: Chart Object