0
votes

I am using Fusion Charts in Angular 7 and I want to export this chart in Base64 Image format.

I already tried the batchExport method to export the chart as an image.

app.component.ts:

import * as FusionCharts from "fusioncharts";

ngOnInit() {
  this.exportChart = {
    chart: {
      xaxisname: Month,
      yaxisname: Count,
      borderThickness: "4",
      showvalues: "1",
      theme: "fusion",
      data: chartData
    };
  }

  exportData() {
    FusionCharts.batchExport({
      exportFileName: "demoExport",
      exportFormat: "jpg",
      exportAtClientSide: "1"
    });
  }
}

app.component.html:

<button id='export_charts' (click)='exportData()' class="mb-10">Export Chart</button>

Please help me.

Thanks.

1

1 Answers

0
votes

If you are looking to get base64 image you can simply apply exportEnabled attribute at the chart level and set as 1, here is a detailed link - https://www.fusioncharts.com/dev/exporting-charts/using-fc-export-server/exporting-charts-as-image-and-pdf

 "chart": {
        "exportEnabled": "1"
    }

The batch export does not seem to be working in angular here is a link to the issue logged - https://github.com/fusioncharts/angular-fusioncharts/issues/59