Show / Hide Table of Contents

Other Exports

Export to Visio

With Visio you have most of the export functionalities as in PDF/PNG Export


Visio also uses the export server to do the export.

Visio options

 
         
chart.exportToVisio({
        fileName?: string,
        padding?: number,
        margin?: Array,
        expandChildren?: boolean,
        childLevels?: boolean,
        parentLevels?: boolean,
        min?: boolean,
        header?: string,
        footer?: string 
});
     

Not all the options can work together.

Here is a Code example with all the Visio export options:


Important note:
When you export to Visio, the data is temporarily sent and stored on BALKAN App's server for a duration of one hour.
If you prefer not to have data stored on BALKAN App's server for privacy reasons, you have the option to install your own server.
API Removal Notice (Version 9)
The following method has been removed in version 9: exportVisio
Please use instead: exportToVisio

Export to CSV

You can add the CSV export as a menu item in the menu:

 
         
menu: {
    csv_export: { text: "Export CSV" },
}
 
and/or in the nodeMenu option:
 
         
nodeMenu: {
    csv_export: { text: "Export CSV" },
}
 

Here is the result:


Export to XML

You can add the XML export as a menu item in the menu:

 
         
menu: {
    xml_export: { text: "Export XML" },
}
 
and/or in the nodeMenu option:
 
         
nodeMenu: {
    xml_export: { text: "Export XML" },
}
 

Here is the result:


Export to JSON

You can add the JSON export as a menu item in the menu:

 
         
menu: {
    json_export: { text: "Export JSON" },
}
 
and/or in the nodeMenu option:
 
         
nodeMenu: {
    json_export: { text: "Export JSON" },
}
 

Here is the result:


CSV / XML / JSON export options

 
     
    chart.exportToCSV({
        filename: "myChart.csv",
        nodeId: id,
    });
     

Here is a code example:


Export event listeners

You could use onExportStart and onExportEnd methods to change the export behavior.

 
     
// add before chart.load()
chart.onExportStart(() => {
    console.log("exporting")
});
     

Here is an example of how you could get only the name and the title fiedls, changing args.nodes:

 
 
// add before chart.load()
chart.onExportStart((args) => {
    if (args.ext == 'csv' || args.ext == 'xml'){
        var newNodes = [];
        for(var i = 0; i < args.nodes.length; i++){
            newNodes.push({
                name: args.nodes[i].name,
                title: args.nodes[i].title
            })
        }
        args.nodes = newNodes;
    }
});
     

Use return false to avoid exporting:

 
     
// add before chart.load()
chart.onExportStart(() => {
    // add your code here
    return false;
});