### Creating a Chart Template

See [microsofts offical documentation](<https://support.microsoft.com/en-us/office/save-a-custom-chart-as-a-template-259a5f9d-a9ec-4b3f-94b6-9f5e55187f2a>) 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.

```csharp
//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";
```

```vbnet
'Add an Area chart from a template file.
Dim areaChart = ws.Drawings.AddChartFromTemplate(New FileInfo("c:\Temp\AreaChartStyle3.crtx"), "areaChart").As.Chart.AreaChart

Dim 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

- [Sample 5.3-C\#](<https://github.com/EPPlusSoftware/EPPlus.Samples.CSharp/tree/master/05-Drawings charts and themes/03-Charts and themes>) or [Sample 5.3-VB](<https://github.com/EPPlusSoftware/EPPlus.Samples.VB/tree/master/05-Drawings charts and themes/03-Charts and themes>)
- [Charts start page](<https://epplussoftware.com/docs/charts-and-drawing-objects/charts/index.md>)
