FormulaEngineer examples
Create, read, and style Excel workbooks in .NET.
Style workbooks as you write them — fonts, fills, borders,
number formats, alignment, and layout — using
ExcelStyledWriter. Every example below is a complete,
runnable snippet.
Group
Cells and text
10
Layout
10
Conditional formatting
6
Named styles and themes
4
Tables and notes
10
Images and shapes
4
Charts and sparklines
6
Dashboards
4
Example
6
examples
in Charts and sparklines
Line chart with markers
EnableChartsPlots two series on one chart, each with its own value range but a shared category axis — the shape most trend comparisons need.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
var stylingOptions =
new ExcelStylingOptions
{
EnableCharts = true
};
using (var writer = new ExcelStyledWriter("line-chart-with-markers.xlsx", null, stylingOptions))
{
using (var sheet = writer.CreateWorksheet("Trend"))
{
sheet.WriteRow("Month", "North", "South");
sheet.WriteRow("Jan", 10, 7);
sheet.WriteRow("Feb", 14, 11);
sheet.WriteRow("Mar", 12, 16);
sheet.WriteRow("Apr", 18, 15);
sheet.AddChart(
ExcelChart.Create(
ExcelChartKind.LineWithMarkers,
ExcelDrawingAnchor.OneCell(5, 2, 460d, 260d),
new[]
{
ExcelChartSeries.Create("North", "'Trend'!$A$2:$A$5", "'Trend'!$B$2:$B$5"),
ExcelChartSeries.Create("South", "'Trend'!$A$2:$A$5", "'Trend'!$C$2:$C$5")
},
title: "Regional trend",
categoryAxisTitle: "Month",
valueAxisTitle: "Score"));
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.