FusionCharts API-Methods: exportChart

Created using FusionCharts Suite XT - www.fusioncharts.com

by Venkatesan S

HTML

<script src="http://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/fusioncharts.charts.js"></script>
<script src="http://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js"></script>
<!-- This sample shows the usage of the exportChart() method. -->
<div id="indicatorDiv">Method Name: <b>exportChart()</b>

  <center>
    <button id="export"><b>Export Chart</b>
    </button>
    <br/>
  </center>
</div>
<div id="chart-container">FusionCharts will render here</div>

CSS

body {
  padding: 5px;
  margin: 0 auto;
}

#indicatorDiv {
  width: 500px;
  font-family: 'Arial', 'Helvetica';
  font-size: 13px;
}

#format {
  height: 25px;
  font-size: 12px;
}

#export {
  height: 25px;
  font-size: 13px;
}

JavaScript

FusionCharts.ready(function() {
  var revenueChart = new FusionCharts({
    id: 'dash',
    type: 'mscombidy2d',
    renderAt: 'chart-container',
    width: '500',
    height: '300',
    dataFormat: 'json',
    dataSource: {
      "chart": {
        "caption": "Harry's SuperMart",
        "subCaption": "Sales analysis of last year",
        "xAxisname": "Month",
        "yAxisName": "Amount (In USD)",
        "numberPrefix": "$",
        "showBorder": "0",
        "showValues": "0",
        "paletteColors": "#0075c2,#1aaf5d,#f2c500",
        "bgColor": "#ffffff",
        "showCanvasBorder": "0",
        "canvasBgColor": "#ffffff",
        "captionFontSize": "14",
        "subcaptionFontSize": "14",
        "subcaptionFontBold": "0",
        "divlineColor": "#999999",
        "divLineIsDashed": "1",
        "divLineDashLen": "1",
        "divLineGapLen": "1",
        "showAlternateHGridColor": "0",
        "usePlotGradientColor": "0",
        "toolTipColor": "#ffffff",
        "toolTipBorderThickness": "0",
        "toolTipBgColor": "#000000",
        "toolTipBgAlpha": "80",
        "toolTipBorderRadius": "2",
        "toolTipPadding": "5",
        "legendBgColor": "#ffffff",
        "legendBorderAlpha": '0',
        "legendShadow": '0',
        "legendItemFontSize": '10',
        "legendItemFontColor": '#666666',
        "exportEnabled": "1"
      },
      "categories": [{
        "category": [{
          "label": "Jan"
        }, {
          "label": "Feb"
        }, {
          "label": "Mar"
        }, {
          "label": "Apr"
        }, {
          "label": "May"
        }, {
          "label": "Jun"
        }, {
          "label": "Jul"
        }, {
          "label": "Aug"
        }, {
          "label": "Sep"
        }, {
          "label": "Oct"
        }, {
          "label": "Nov"
        }, {
          "label": "Dec"
        }]
      }],
      "dataset": [{
        "seriesName": "Actual Revenue",
        "showValues": "1",
        "data": [{
        ...