차트의 Exporting 오브젝트를 반환한다.
Type | Description |
---|---|
INSTANCE | 차트의 Exporting 오브젝트 |
// AMCHARTS5 컴포넌트 차트 내용을 이미지 Data URI 형태로 추출하여,
// 이미지 컴포넌트에 설정하는 샘플
function btn_on_mouseup(objInst)
{
var exporting, chart_width, chart_height, _img;
// amchart는 AMCHARTS5 컴포넌트 이름
// AMCHARTS5 컴포넌트의 Exporting 오브젝트를 구함
exporting = amchart.getexporting();
if (exporting == null) { return; }
chart_width = amchart.getwidth();
chart_height = amchart.getheight();
// img는 이미지 컴포넌트 이름
// 이미지 크기 맞춤
img.setsize(chart_width, chart_height);
// AMCHARTS5 컴포넌트의 Exporting 오브젝트를 이용하여 이미지 데이터를
// Data URI 형태로 추출하여 이미지 컴포넌트에 설정 (Promise 형태)
// Data uri form of data is suitable for use right away.
// For example you can use it exported image as an src attribute
// of an
tag, or stream it as binary.
_img = img;
exporting.export("png").then(function(imgData) {
// alert(imgData);
_img.setimagedata(imgData);
});
}