Skip to main content
A newer version of this page is available. .
All docs
V21.2
.NET Framework 4.5.2+

OfficeChartsCrossPlatformExtensions.ActivateCrossPlatformCharts(OfficeCharts) Method

Enables Spreadsheet chart support for the Word Processing Document API.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this method in production code.

Namespace: DevExpress.XtraSpreadsheet.Services

Assembly: DevExpress.Docs.v21.2.dll

Declaration

public static void ActivateCrossPlatformCharts(
    this OfficeCharts instance
)

Parameters

Name Type Description
instance OfficeCharts

An OfficeCharts instance.

Remarks

The Word Processing Document API uses Spreadsheet Chart API to import, generate, save, print, and export documents with charts to PDF. Follow the steps below to enable spreadsheet charts in your word processing app:

  1. Add references to the following assemblies:

    • DevExpress.Docs.v21.2.dll
    • DevExpress.Spreadsheet.v21.2.Core.dll
    • DevExpress.Charts.v21.2.Core.dll
    • DevExpress.XtraCharts.v21.2.dll
    • DevExpress.DataVisualization.v21.2.Core.dll
    • DevExpress.TreeMap.v21.2.Core.dll
    • DevExpress.XtraTreeMap.v21.2.dll
  2. Call the ActivateCrossPlatformCharts method before you create a RichEditDocumentServer instance:

    using DevExpress.Office.Services;
    using DevExpress.XtraSpreadsheet.Services;
    using DevExpress.XtraRichEdit;
    // ...
    
    static void Main(string[] args)
    {
        OfficeCharts.Instance.ActivateCrossPlatformCharts();
        using(var wordProcessor = new RichEditDocumentServer())
        {
            // ...
        }
    }
    

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 create and modify charts in the Word Processing Document API: Charts in Word Documents.

See Also