Skip to main content
All docs
V23.2

OfficeChartsWpfExtensions.ActivateWpfCharts(OfficeCharts) Method

Enables Spreadsheet chart support for the WPF Rich Text Editor.

Namespace: DevExpress.Xpf.Spreadsheet.Services

Assembly: DevExpress.Xpf.Spreadsheet.v23.2.dll

NuGet Package: DevExpress.Wpf.Spreadsheet

Declaration

public static void ActivateWpfCharts(
    this OfficeCharts instance
)

Parameters

Name Type Description
instance OfficeCharts

An OfficeCharts instance.

Remarks

The WPF Rich Text Editor uses WPF 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.v23.2.Core.dll
    • DevExpress.Xpf.Spreadsheet.v23.2.dll
    • DevExpress.Charts.v23.2.Core.dll
    • DevExpress.Xpf.Charts.v23.2.dll
    • DevExpress.DataVisualization.v23.2.Core.dll
    • DevExpress.TreeMap.v23.2.Core.dll
    • DevExpress.Xpf.TreeMap.v23.2.dll
  2. Call the ActivateWpfCharts method before the control is initialized:

    using DevExpress.Office.Services;
    using DevExpress.Xpf.Spreadsheet.Services;
    // ...
    
    public Form1()
    {
        OfficeCharts.Instance.ActivateWpfCharts();
        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