private double strokeThickness;
private Brush stroke;
private Brush fillBrush;
private double chartFontSize;
private double axisFontSize;
private FontFamily fontFamily;
private FontStyle fontStyle;
private FontWeight fontWeight;
private FontStretch fontStretch;
private Brush foreground;
strokeThickness = 2;
stroke = new SolidColorBrush(Colors.Green);
fillBrush = new SolidColorBrush(Colors.Red);
foreground = new SolidColorBrush(Colors.Blue);
chartFontSize = 25;
axisFontSize = 25;
fontFamily = new FontFamily("Arial Narrow");
fontStyle = FontStyles.Italic;
fontWeight = FontWeights.Bold;
fontStretch = FontStretches.ExtraExpanded;
GrapeCity.Windows.SpreadSheet.Data.SpreadChart chart = new GrapeCity.Windows.SpreadSheet.Data.SpreadChart("Chart", GrapeCity.Windows.SpreadSheet.Data.SpreadChartType.BarStacked, "Sheet1!$A$1:$A$7", 0, 0, 200, 200);
gcSpreadSheet1.ActiveSheet.SetArray(0, 0, new object[,] { { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { 6 }, { 7 }, { 8 }, { 9 }, { 10 } });
GrapeCity.Windows.SpreadSheet.Data.Legend chartLegend = new GrapeCity.Windows.SpreadSheet.Data.Legend();
chartLegend.Fill = fillBrush;
chartLegend.FontSize = chartFontSize;
chartLegend.FontFamily = fontFamily;
chartLegend.FontStretch = fontStretch;
chartLegend.FontStyle = fontStyle;
chartLegend.FontWeight = fontWeight;
chartLegend.Foreground = foreground;
chartLegend.Stroke = stroke;
chartLegend.StrokeThickness = strokeThickness;
chartLegend.Orientation = Orientation.Vertical;
chartLegend.Alignment = GrapeCity.Windows.SpreadSheet.Data.LegendAlignment.TopCenter;
chartLegend.Text = "Legend";
chartLegend.StrokeDashType = GrapeCity.Windows.SpreadSheet.Data.StrokeDashType.Dash;
chart.Legend = chartLegend;
gcSpreadSheet1.ActiveSheet.Charts.Add(chart);