Namespace: GlobFX.SwiffChartGenerator
Assembly: GlobFX.SwiffChartGenerator (in GlobFX.SwiffChartGenerator.dll)

Generates the chart in the requested format and write it to a file.

Visual Basic
Public Sub ExportAsFile( filename As String )
C#
public void ExportAsFile( string filename );

Arguments

filename
A string that specifies the name of the saved file.

Remarks

If the system fails to create or generate the output file, the ExportAsFile method raises an error.

The format of the generated file (SVG, PNG, JPG, SWF or PDF file) can be specified by the OutputFormat property.

Sample Code

The following code illustrates use of the ExportAsFile method.

Visual Basic
' Create the chart series
Dim values_1(2) As Integer
Dim values_2(2) As Integer

values_1(0) = 10
values_1(1) = 20
values_1(2) = 30

values_2(0) = 100
values_2(1) = 200
values_2(2) = 300

chart.SetSeriesValuesFromArray( 0, values_1 )
chart.SetSeriesValuesFromArray( 1, values_2 )

' Set the graphics settings from a style file
chart.LoadStyle("C:\\myStyle.scs")

' The chart is complete, we can now generate the movie
chart.ExportAsFile("C:\\Inetpub\\wwwroot\\charts_cache\\MyChart.swf")
C#
// Create the chart series
int[] values_1= new int[3];
int[] values_2= new int[3];

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

values_2[0] = 100;
values_2[1] = 200;
values_2[2] = 300;

chart.SetSeriesValuesFromArray(0, values_1);
chart.SetSeriesValuesFromArray(1, values_2);

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

// The chart is complete, we can now generate the movie
chart.ExportAsFile(@"C:\Inetpub\wwwroot\charts_cache\MyChart.swf");

See Also

ExportAsResponse Method | ExportAsBinary Method | OutputFormat Property

Applies To: Chart Object