Specifies the output format of the generated chart.

object.SetOutputFormat( 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 and ExportAsBinary generates 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. Macromedia Flash movie)

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

Code Definition
"SWF"
Macromedia Flash movie
"JPG"
JPG Image
"PNG"
PNG Image (Portable Network Graphics)

JScript Sample Code

The following JScript code illustrates use of the SetOutputFormat method.

//Create the chart series
var categories= new Array(3);
var values= new Array(3);

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

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

chart.SetCategoriesFromArray( categories );

chart.AddSeries();
chart.SetSeriesValuesFromArray( 0, values );

//Set the chart title
chart.SetTitle( "My Chart" );

//Set the horizontal axis title
chart.SetAxisTitle( 0, "Months" );

//Set the vertical axis title
chart.SetAxisTitle( 1, "Values in million" );

//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

GetOutputLocation Method | ExportAsResponse Method | ExportAsFile Method | ExportAsBinary Method

Applies To: Chart Object