ChartControl.PrintInitialize Event
Allows you to customize print and export options before the chart is printed or exported.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.2.UI.dll
NuGet Package: DevExpress.Win.Charts
#Declaration
public event ChartPrintInitializeEventHandler PrintInitialize
#Event Data
The PrintInitialize event's data class is ChartPrintInitializeEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Link |
Gets a Printable |
Printing |
Returns the Printing System used to create and print a document for the link associated with the Chart Control. |
#Remarks
You can preview, print and export the chart if the Printing-Exporting library is available and the DevExpress.XtraPrinting.24.2 and DevExpress.Printing.v24.2.Core assemblies are added to the project.
#Example
The following code shows how to use the ChartControl.PrintInitialize
event to configure the chart’s print options before the chart is previewed.
using DevExpress.XtraPrinting;
//...
chartControl.PrintInitialize += chartControl_PrintInitialize;
private void chartControl_PrintInitialize(object sender, DevExpress.XtraCharts.ChartPrintInitializeEventArgs e) {
PrintingSystemBase printingSystem = e.PrintingSystem as PrintingSystemBase;
printingSystem.PageSettings.Landscape = true;
}
// Preview the chart in the landscape orientation.
chartControl.ShowPrintPreview();