[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Member Tables
  [Expand]Tree List
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Data Processing
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Collapse]Examples
    [Expand]General
    [Expand]Creating Charts
    [Expand]Chart Elements
    [Expand]End-User Interaction
    [Collapse]Producing Output
      How to: Save and Restore a Layout
      How to: Print a Chart and Show Its Print Preview
      How to: Export a Chart to PDF
      How to: Export a Chart to HTML and MHT
      How to: Export a Chart to XLS
      How to: Export a Chart to Image
   [Expand]Additional Resources
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Export a Chart to Image

The following example demonstrates how to export a chart to an image. The GetChartImage method returns the image in the specified format, while the SaveChartImageToFile writes the chart's image in the specified format to the specified path.

  • Create a ChartControl (see ChartControl) and populate it with data.

    Note

    Add references to the following assemblies to use the ChartControl in your application:

    • DevExpress.Data.v19.1.dll
    • DevExpress.Utils.v19.1.dll
    • DevExpress.XtraEditors.v19.1.dll
    • DevExpress.Charts.v19.1.Core.dll
    • DevExpress.XtraCharts.v19.1.dll
    • DevExpress.XtraCharts.v19.1.UI.dll

    See Deployment for more information.

  • Use the ChartControl.ExportToImage method to create an image from a chart.

Is this topic helpful?​​​​​​​