
IMPORTANT! Settings passed in these methods' arguments do not reset current export settings. The settings structure is identical to the structure of the node.Ī sample for saving a chart using XML String settings:Ī sample for saving a chart using JavaScript Object settings:Ĭhart.exportAsPNG() You can also specify custom settings (as an XML String JavaScript Object). Like blue color background in all slice of level-1. Now I want to fill different colors on each level. Would save the chart with the settings specified in the configuration file. I have created a sunburst chart with the help of the Anychart library. When exporting a chart by calling the JavaScript functions exportAsPNG or getPNGImageBase64Encoded, the settings used by default are the ones specified in the configuration file. ĮxportAsPNG and getPNGImageBase64Encoded Function Parameters This functionality is identical for the PNG, JPG and PDF formats and is covered in detail in Using Custom Export Size. When necessary, it allows using custom size (in pixels) when exporting using different chart scaling modes. Here is a sample syntax for changing the default target file name:īy default, the component exports the chart to PNG images with the same dimensions and in the same scale as it is presented on the HTML page.

To change the target file name, you need to use the file_name attribute. By default, it is set to #FFFFFF.Īll the PNG settings specified in the configuration file apply when exporting the chart to the PNG format with a command from the context menu and are also considered when exporting by calling the JavaScript functions exportAsPNG and getPNGImageBase64Encoded.īy default, when a chart is saved to a PNG image, the file gets the name " An圜hartStock.png".

If this attribute is set to true, the PNG image will be saved with transparent background otherwise, the background will have the color set by the background_color attribute. By default, the value used is "An圜hartStock.png" When changing this attribute, it is mandatory to specify the ".png" extension. Sets name for the file the PNG image will be saved to. This setting is applicable only when the resizing_mode attribute is set to Fit or RecalculateByProportions. If this attribute is set to true, the extra space without elements of the chart will be cropped when exporting. This setting is applicable only when size="Custom". Sets chart resizing mode when using custom size of exported image: This setting is applicable only when size="Custom".

Sets exported image size mode: Original - uses the original chart width and height it embedded in the page with Custom - allows setting custom width and height for the exported image.įit Recalculate Stretch RecalculateByProportions Here is the table of attributes, descriptions and values available in the node: Attribute
