GroupDocs.Assembly for .NET

Embed charts in XLSX files with .NET API

GroupDocs.Assembly for .NET provides a powerful way to populate XLSX files with dynamic data and integrate charts effortlessly.

How to add a chart to a XLSX document

GroupDocs.Assembly makes it simple to generate and embed charts into your XLSX templates. Supports a variety of chart types, such as bar, pie, and line charts.

  1. Design a XLSX template with placeholders for the charts.
  2. Retrieve your data from a compatible source.
  3. Define chart options like type, labels, and color scheme.
  4. Save the updated file with the chart embedded.
// Include this tag in your template to generate a chart
// Orders Prices by months<<y [Sum(c => c.Price)]>><<size [Count()]>>

// Specify the file path for your template
string template = "chart_template.xlsx";

// Load data from your preferred source
DataSourceInfo data 
    = new DataSourceInfo(GetChartData(), "orders");

// Save the document with the chart embedded
DocumentAssembler asm = new DocumentAssembler();
asm.AssembleDocument(template, "result.xlsx", data);
dotnet add package GroupDocs.Assembly
click to copy
copied
More examples Documentation

Add dynamic charts to your documents effortlessly

GroupDocs.Assembly for .NET simplifies the creation of data-driven documents in widely-used formats. Use templates to insert charts, tables, barcodes, lists, hyperlinks, and images with advanced, dynamic data integration.

Key features of GroupDocs.Assembly

Convert data into professional charts

Turn data from JSON, XML, CSV, and other sources into visually appealing charts with just a few steps using our API.

Create visually engaging content

GroupDocs.Assembly supports multiple chart types like bar graphs, pie charts, and line graphs. Combine these with tables, barcodes, images, and other elements to create professional reports.

Precisely position and customize charts

With LINQ syntax, you can dynamically generate and place charts exactly where needed. Easily customize styles, colors, and layout to match your requirements.

Works with various file formats

Produce documents in popular formats like MS Office, PDF, OpenOffice, and HTML. Embed charts seamlessly into any supported format with full compatibility.

Create a chart programmatically

This example demonstrates how to dynamically create and embed a chart into a XLSX document.

C#

// Prepare a template with a placeholder for the chart
// Total Contract Price<<y [m.Total_Contract_Price]>>
// <<seriesColor [color]>>

// Provide the path to the template file
string template = "table_template.xlsx";

// Retrieve the data from your source
JsonDataSource data_json = 
  new JsonDataSource("Items.json");

// Build a data object with the necessary information
DataSourceInfo data 
    = new DataSourceInfo(data_json, "items");

// Set up chart properties such as type and appearance
DataSourceInfo design 
    = new DataSourceInfo("red", "color");

// Initialize DocumentAssembler
DocumentAssembler asm = new DocumentAssembler();

// Export the document with the chart included
asm.AssembleDocument(template, "result.xlsx", data, design);
dotnet add package GroupDocs.Assembly
click to copy
copied
More examples Documentation

What is GroupDocs.Assembly for .NET?

GroupDocs.Assembly for .NET is a tool designed to streamline the creation of documents and reports by integrating data from various sources. Easily generate charts, tables, lists, barcodes, and images dynamically. Advanced formatting options allow precise placement and customization of your content. It supports over 50 file formats, including PDFs, MS Office documents, and emails.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Assembly for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Discover key capabilities

Our platform helps you create compelling, data-driven documents tailored to your needs.

Create visually rich reports in multiple formats

.NET allows you to generate documents with integrated charts across 50+ supported formats, combining templates with your data seamlessly.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English