본문으로 건너뛰기

exportToPNG

Description

PNG 형식으로 간트 차트를 내보냅니다

exportToPNG: (export?: any) => void

Parameters

  • export - object - optional, an object with export settings (see the details)

  • export - 객체 - 선택적, 내보내기 설정이 담긴 객체(세부 내용 참조)

Example

gantt.exportToPNG();

//또는
gantt.exportToPNG({
name: "mygantt.png"
});

//또는
gantt.exportToPNG({
name: "mygantt.png",
header: "<h1>My company</h1>",
footer: "<h4>Bottom line</h4>",
locale: "en",
start: "01-04-2026",
end: "11-04-2026",
skin: "terrace",
data: { },
server: "https://myapp.com/myexport/gantt",
raw: true,
callback: (res) => {
alert(res.url);
}
});

Details

노트

이 메서드는 export 확장에 정의되어 있으므로 export_api 플러그인을 활성화해야 합니다. 자세한 내용은 문서를 참조하십시오.

노트

Gantt 버전이 8.0 미만인 경우 온라인 내보내기 서비스를 활성화하려면 페이지에 https://export.dhtmlx.com/gantt/api.js를 포함해야 합니다. 예:

<script src="codebase/dhtmlxgantt.js"></script>
<script src="https://export.dhtmlx.com/gantt/api.js"></script>

exportToPNG 메서드는 여러 선택적 속성을 포함하는 객체를 파라미터로 받습니다:

큰 Gantt 차트를 조각별로 내보내기

대용량 파일의 최대 크기는 10000х10000입니다.

한 쪽의 크기를 키우고 다른 한 쪽을 이에 맞춰 줄일 수 있지만, width와 height의 곱이 100000000(10000×10000)을 넘으면 출력 PNG 이미지가 잘립니다.

또한 additional_settings의 slice_archive 속성을 사용하여 조각으로 Gantt를 내보내고 아카이브로 얻는 기능이 있습니다:

gantt.exportToPNG({
server: "https://export.dhtmlx.com/beta/gantt",
additional_settings: {
//width: 2000,
//height: 2000,
slice_archive: { width: 2000, height: 2000 },
slice_check: true,
}
});

예제: PNG 이미지로 내보내기

You can either define the sizes of the output PNG images via setting the attribute as an object with the width and height options:

slice_archive: { width: 2000, height: 2000 }

or you can set the attribute to true. In this case, the exported pieces of the gantt will have default sizes: 1000×1000.

slice_archive: true

시간 제한

노트

note 내보내기 서비스는 처리 시간 제한이 있습니다.

내보내기가 20초 이상 걸리면 취소되며 다음 오류가 표시됩니다:

Error: Timeout trigger 20 seconds

여러 사용자가 동시에 내보내기를 수행하면 처리 시간이 늘어날 수 있으나, 각 사용자의 내보내기 시간은 별도로 추적됩니다.

노트

note 큰 차트를 내보낼 때는 standalone export module 사용을 고려하세요. 이 모듈은 Commercial, Enterprise, Ultimate 라이선스에 무료로 포함되어 있거나, 별도로 여기서 구매할 수 있습니다.

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.