diff --git a/Create and Edit Charts/Legend/.NET/Legend/Legend/Program.cs b/Create and Edit Charts/Legend/.NET/Legend/Legend/Program.cs index 3bc011a1..75d27e17 100644 --- a/Create and Edit Charts/Legend/.NET/Legend/Legend/Program.cs +++ b/Create and Edit Charts/Legend/.NET/Legend/Legend/Program.cs @@ -35,6 +35,9 @@ public static void Main(string[] args) //Set the color chart.Legend.TextArea.Color = ExcelKnownColors.Pink; + //Set the background color + chart.Legend.FrameFormat.Fill.ForeColorIndex = ExcelKnownColors.Yellow; + //Set the font chart.Legend.TextArea.Bold = true; chart.Legend.TextArea.FontName = "Times New Roman"; @@ -42,7 +45,7 @@ public static void Main(string[] args) chart.Legend.TextArea.Strikethrough = false; //Remove the legend - chart.Legend.LegendEntries[0].IsDeleted = true; + chart.Legend.LegendEntries[0].Delete(); //Set Legend without overlapping the chart chart.Legend.IncludeInLayout = true;