exportToPNG

exports a Gantt chart into the PNG format

void exportToPNG(object export);

Parameters

exportobjectan object with export settings (see the details)

Example

gantt.exportToPNG();
 
//or
gantt.exportToPNG({
  name: "mygantt.png"
});
 
//or
gantt.exportToPNG({
    name:"mygantt.png",
    header:"<h1>My company</h1>",
    footer:"<h4>Bottom line</h4>",
    locale:"en",
    start:"01-04-2013",
    end:"11-04-2013",
    skin:'terrace',
    data:{ },
    server:"https://myapp.com/myexport/gantt",
    raw:true
});

Details

This method is defined in the export extension, so you need to include it on the page:

<script src="http://export.dhtmlx.com/gantt/api.js"></script>

Read the details in the Export to PDF and PNG article.

The exportToPNG method takes as a parameter an object with a number of properties (all of the properties are optional):

See also
Back to top