Print in WPF Chart (Classic)

5 May 20211 minute to read

Essential Chart for WPF now comes with support to print the chart and printing options such as page orientation, print preview, color mode, and more.

Chart-Controls_images237

Use Case Scenarios

Printing the chart is useful for visual representation in organizational meetings.

Chart-Controls_images238

Methods

Method Description Parameters Type Return Type
Print() Used to print tde Chart control. tdis opens tde printing dialog box. tdis metdod returns a bool value after printing. Overloads: (Rect printArea) N/A Bool
PrintSwitchMode() To select a particular area for printing. N/A N/A Void

..My Documents\Syncfusion\EssentialStudio<Version Number>\WPF\Chart.WPF\Samples\3.5\WindowsSamples\Export and Print\Printing Chart Demo

Charts can be printed by using the following code example.

<!--Button when clicked executes the Print command-->

<Button Grid.Row="0" Content="Print"						Command="{x:Static ApplicationCommands.Print}"						CommandTarget="{Binding ElementName=Chart1}" x:Name="button"/>            <!--Button when clicked executes the SwitchPrinting command-->            <Button Grid.Row="0" Grid.Column="1" Content="Printing Mode" 						Command="{x:Static syncfusion:ChartCommands.SwitchPrinting}"						CommandTarget="{Binding ElementName=Chart1}" x:Name="button1" />
Chart1.Print();

Chart1.PrintSwitchMode();