!!!###!!!title=gantt export image——VisActor/VTable tutorial documents!!!###!!!!!!###!!!description= !!!###!!!

Gantt Chart Export Plugin

Feature Introduction

ExportGanttPlugin is a plugin written to support the full export of Gantt charts and to adapt to the size of the Gantt chart.

This plugin will take effect when the Gantt chart is being constructor

When you need to export an image, you can executeexportGanttPlugin.exportToImage to do so.

However, since the current implementation principle is to create a container large enough to hold the entire gantt component, and then put our gantt component in it and export it using the toDataURL, there will be a size limit, which may lead to export failure

Plugin Configuration

When you callexportGanttPlugin.exportToImage,it also needs to accept the following parameters to change the export image settings

fileName: 'Gantt chart export test',
type: formatSelect.value as 'png' | 'jpeg',
// resolution ratio
scale: Number(scaleSelect.value),
backgroundColor: bgColorInput.value,
// The quality of the exported pictures
quality: 1

Plugin example

Initialize the plugin object and add it to the plugins in the Gantt configuration

const exportGanttPlugin = new ExportGanttPlugin();
const option = {
  records,
  columns,
  padding: 30,
  plugins: [exportGanttPlugin]
};

This document was contributed by:

Abstract chips