This example uses the chart simple api to change the output format based on the api. The general procedure is to create your chart, then name it eg mychart in the general properties and then use a beforeFactory script to modify the chart before it runs. This example uses the following script:
var mychart =this.getReportElement("mychart");
mychart.setOutputType(params["ChartFormat"].value);
<br />
Below are some more examples
var chart1 = this.getReportElement( "Chart1" )
var chart2 = this.getReportElement( "Chart2" )
var chart3 = this.getReportElement( "Chart3" )
var chart4 = this.getReportElement( "Chart4" )
var chart5 = this.getReportElement( "Chart5" )
var chart6 = this.getReportElement( "Chart6" )
var chart7 = this.getReportElement( "Chart7" )
var chart8 = this.getReportElement( "Chart8" )
var chart9 = this.getReportElement( "Chart9" )
var chart10 = this.getReportElement( "Chart10" )
var chart11 = this.getReportElement( "Chart11" )
var chart12 = this.getReportElement( "Chart12" )
var chart13 = this.getReportElement( "Chart13" )
var color1 = chart1.getTitle().getCaption().getColor()
var color2 = chart2.getTitle().getCaption().getColor()
var font = chart3.getTitle().getCaption().getFont()
chart1.setColorByCategory( true );
chart1.getTitle().getCaption().setValue( "Color by Category" );
chart1.setColorByCategory( true );
chart1.getTitle().getCaption().setValue( "Color by Category" );
chart2.setColorByCategory( false );
chart2.getTitle().getCaption().setValue( "Color by Value Series" );
color1.setRed( 255 );
color1.setGreen( 0 );
color1.setBlue( 0 );
chart1.getTitle().getCaption().setColor( color1 );
chart2.setColorByCategory( false );
chart2.getTitle().getCaption().setValue( "Color by Value Series" );
color2.setRed(255);
color2.setTransparency( 127 );
chart3.getDescription().setValue("newDesc");
chart3.getTitle().getCaption().setValue( chart3.getDescription().getValue() );
font.setSize( 9 );
font.setBold( false );
font.setItalic( true );
font.setStrikeThrough( true );
font.setUnderline( true );
chart4.setDimension( "ThreeDimensional" )
chart5.setDimension( "TwoDimensional" )
chart6.setDimension( "TwoDimensionalWithDepth" )
chart7.setDimension( "TwoDimensional" )
chart8.setDimension( "TwoDimensionalWithDepth" )
chart9.setDimension( "ThreeDimensional" )
chart10.getCategory().setSorting( "Descending" )
chart10.getTitle().getCaption().setValue(chart10.getCategory( ).getOptionalValueGroupingExpr())
chart11.getTitle().getCaption().setValue( chart11.getOutputType() )
chart12.setOutputType("PNG")
chart12.getTitle().getCaption().setValue( chart12.getOutputType() )
chart13.getLegend( ).setVisible( true );
chart13.getLegend( ).setShowValue( true );
chart13.getLegend( ).getTitle( ).setVisible( true );
chart13.getLegend( ).getTitle( ).getCaption( ).setValue( "Legend" )