Skip to content

ChartPrintExportOptions API

Extended documentation for the ChartPrintExportOptions interface with detailed information on the module's properties and available APIs.

Demos

Import

import { ChartPrintExportOptions } from '@mui/x-charts-pro'


The options to apply on the Print export.

Properties

Optional

If true, the styles of the page the chart belongs to will be copied to the export iframe.
Copying styles is useful to ensure that the exported chart looks the same as it does on the page.

Type:boolean

Default:true


Optional

The name of the file without the extension.

Type:string

Default:The title of the document the chart belongs to


Optional

A nonce to be used for Content Security Policy (CSP) compliance.
If provided, this nonce will be added to any style elements created during the export process.
Required when the CSP restricts styles with a nonce, otherwise the export fails because the
copied styles are blocked.

Type:string


Optional

Callback function that is called before the export is triggered.
It can be used to modify the iframe or perform any other actions before the export, such as updating styles,
removing elements, etc.

Type:(iframe: HTMLIFrameElement) => Promise<void> | void


Optional

Callback function that is called when a stylesheet, or a stylesheet it imports, fails to load in the export document,
for example if a request fails or a Content Security Policy blocks it.
Return or resolve to false to cancel the export without an error.
Throw or reject to make the export fail with that error.
Return anything else to continue the export, so the result may be missing some styles.
If not provided, the export continues and the failure is logged as a warning in development.

Type:(element: HTMLLinkElement, reason: StylesheetErrorReason) => Promise<boolean | void> | boolean | void