Export

This method is used to Export the chart into several file format. As an example, using Export() function you will be able to save the chart as image.

 

Format:

chart.Export();

 

Example:

 

In the example below, Export method is called inside the MouseLeftButtonUp event. Once you click over the chart, a SaveFileDialog window will open by which you can save the chart either in Jpg or Bmp format.

 

<div id="VisifireChart0">

 

<script type="text/javascript">  

 

          var vChart1 = new Visifire('SL.Visifire.Charts.xap',500,300);        

 

          /* This event will be fired before loading the chart into

             Silverlight user-control. */

vChart1.preLoad = function(args)

{

 

          /* First Chart Reference. If there are multiple charts in a

             XAML file, array of chart references will be available as

             an event argument, e.g. args[0], args[1], args[2] etc. */

 

          var chart = args[0];

 

          /* Attach event handler for MouseLeftButtonUp event on chart

             element. */

 

chart.MouseLeftButtonUp = function(sender, eventArgs) {

     chart.Export();

};

};

 

     vChart1.setDataUri("Sample1.xml");

 

     vChart1.render("VisifireChart0");

 

</script>

</div>

 

You can also save the chart by setting ToolBarEnabled property to True inside chart. If ToolBarEnabled is set to True, a save icon will be displayed at the top right corner of the chart, on click of which a SaveFileDialog window will open by which you can save the chart in Jpg or Bmp format.