Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

OfficeChartsWinFormsExtensions.ActivateWinFormsCharts(OfficeCharts) Method

Enables Spreadsheet chart support for the WinForms Rich Text Editor.

Namespace: DevExpress.XtraSpreadsheet.Services

Assembly: DevExpress.XtraSpreadsheet.v24.2.dll

NuGet Package: DevExpress.Win.Spreadsheet

#Declaration

public static void ActivateWinFormsCharts(
    this OfficeCharts instance
)

#Parameters

Name Type Description
instance OfficeCharts

An OfficeCharts instance.

#Remarks

The WinForms Rich Text Editor uses WinForms Spreadsheet Charts to render, import, and export documents that contain charts. Follow the steps below to enable spreadsheet charts in the Rich Text Editor:

  1. Add references to the following assemblies:

    • DevExpress.Spreadsheet.v24.2.Core.dll
    • DevExpress.XtraSpreadsheet.v24.2.dll
    • DevExpress.Charts.v24.2.Core.dll
    • DevExpress.XtraCharts.v24.2.dll
    • DevExpress.DataVisualization.v24.2.Core.dll
    • DevExpress.TreeMap.v24.2.Core.dll
    • DevExpress.XtraTreeMap.v24.2.dll
  2. Call the ActivateWinFormsCharts method before the control is initialized:

    using DevExpress.Office.Services;
    using DevExpress.XtraSpreadsheet.Services;
    // ...
    
    public Form1()
    {
        OfficeCharts.Instance.ActivateWinFormsCharts();
        InitializeComponent();
    }
    

Charts are stored in the SubDocument.Shapes collection. Use the ShapeCollection.InsertChart method to add a chart to a document.

See the following topic for details on how to use the Spreadsheet Chart API to create and modify charts in the Rich Text Editor: Charts in Rich Text Documents.

See Also