Skip to main content

exportStyles

Optional. Defines the styles that will be sent to the export service when exporting Chart to PDF/PNG

exportStyles?: boolean | string[];

Default value: false

Example

const chart = new dhx.Chart("chart_container", {
type:"area",
scales: {
"bottom" : {
text: 'month'
},
"left" : {
padding: 10,
max: 90
}
},
series: [
{
value: 'company A',
strokeWidth: 2
// more options
}
],
exportStyles: false
});

By default, the exportStyles property is disabled. Thus, when you export Chart, CSS styles included to the page are not sent to the export service. This reduces the size of the exported data.

If you want some styles to be exported, set string values with the absolute paths to the desired styles to the exportStyles array:

const chart = new dhx.Chart("chart_container", {
type:"area",
scales: {
"bottom" : {
text: 'month'
},
"left" : {
padding: 10,
max: 90
}
},
series: [
{
value: 'company A',
strokeWidth: 2
// more options
}
],
exportStyles: [
"https://mySite.com/exportStyle.css",
"https://mySite.com/secondExportStyle.css"
]
});
tip

You must use only absolute paths not relative ones.

info

You need to enable the property if you want to export Chart with a custom or overridden theme.

Related API:

Change log:

added in v8.1