Amchart-导出带有背景图像的饼图吗?

时间:2019-11-27 10:38:08

标签: charts amcharts export-to-pdf

我必须用背景图像制作饼图。单击导出图标时,它将显示添加到CSS的背景图像。但是下载文件时,图像丢失。 我在出口中看到“面料”选项。有设置背景图片的属性或方法吗?

    AmCharts.makeChart( "chartdiv", {
  "export": {
    "enabled": true,
    "fabric":{},
    "menu": [ {
      "class": "export-main",
      "menu": [ {
        "label": "Download",
        "menu": [ "PNG", "JPG", "CSV" ]
      }, {
        "label": "Annotate",
        "action": "draw",
        "menu": [ {
          "class": "export-drawing",
          "menu": [ "PNG", "JPG" ]
        } ]
      } ]
    } ]
  }
} );

1 个答案:

答案 0 :(得分:1)

您可以使用“捕获前”功能设置背景图像。

"export": {
      "enabled": true,
      "pageOrientation": "landscape",
      "beforeCapture": function() { 
           var cloneChart = this.setup.chart;
           cloneChart.backgroundImage="$image_url";
       }
}