Skip to content

Using chart templates

Mats Alm edited this page Nov 10, 2026 · 15 revisions

This page has moved. The current version of this page is at https://epplussoftware.com/docs/charts-and-drawing-objects/charts/using-chart-templates/. The EPPlus documentation is no longer updated in this wiki; please use the EPPlus guides and update your bookmarks.

Creating a Chart Template

See microsofts offical documentation for how to save a custom chart as a template

Loading A Chart Template in Epplus

Starting from Epplus 5 we support Chart Templates (with the crtx extension) via the AddChartFromTemplate method. Crtx files can be exported from Excel from any chart. Chart templates will work for chart types implemented in EPPlus.

//Add an Area chart from a template file.
var areaChart = ws.Drawings.AddChartFromTemplate(new FileInfo(@"c:\Temp\AreaChartStyle3.crtx"), "areaChart").As.Chart.AreaChart;;

var areaSerie = areaChart.Series.Add(ws.Cells[2, 7, 26, 7], ws.Cells[2, 6, 26, 6]);
areaSerie.Header = "Order Value";
areaChart.SetPosition(51, 0, 10, 0);
areaChart.SetSize(1000, 300);
areaChart.Title.Text = "Area Chart";

See also

EPPlus wiki

Versions

Worksheet & Ranges

Styling

Import/Export data

Formulas and filters

Charts & Drawing objects

Tables & Pivot Tables

VBA & Protection

Clone this wiki locally

⌂ 换网址