public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.PieOfPie, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { "Item1", 10, 25, 25 }, { "Item2", -51, -36, 27 }, { "Item3", 52, -85, -30 }, { "Item4", 22, 65, 65 }, { "Item5", 23, 69, 69 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); GrapeCity.Documents.Excel.Drawing.ISeries series1 = shape.Chart.SeriesCollection[0]; series1.HasDataLabels = true; //config secondary section for pie of pie chart shape.Chart.ChartGroups[0].SplitType = GrapeCity.Documents.Excel.Drawing.ChartSplitType.SplitByCustomSplit; series1.Points[0].SecondaryPlot = true; series1.Points[1].SecondaryPlot = false; series1.Points[2].SecondaryPlot = true; series1.Points[3].SecondaryPlot = false; series1.Points[4].SecondaryPlot = true; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.StockVOHLC, 300, 20, 360, 230); worksheet.Range["A1:F23"].Value = new object[, ] { { null, "Volume", "Open", "High", "Low", "Close" }, { new DateTime(2019, 9, 1), 26085, 103.46, 105.76, 92.38, 100.94 }, { new DateTime(2019, 9, 2), 52314, 100.26, 102.45, 90.14, 93.45 }, { new DateTime(2019, 9, 3), 70308, 98.05, 102.11, 85.01, 99.89 }, { new DateTime(2019, 9, 4), 33401, 100.32, 106.01, 94.04, 99.45 }, { new DateTime(2019, 9, 5), 87500, 99.74, 108.23, 98.16, 104.33 }, { new DateTime(2019, 9, 8), 33756, 92.11, 107.7, 91.02, 102.17 }, { new DateTime(2019, 9, 9), 65737, 107.8, 110.36, 101.62, 110.07 }, { new DateTime(2019, 9, 10), 45668, 107.56, 115.97, 106.89, 112.39 }, { new DateTime(2019, 9, 11), 47815, 112.86, 120.32, 112.15, 117.52 }, { new DateTime(2019, 9, 12), 76759, 115.02, 122.03, 114.67, 114.75 }, { new DateTime(2019, 9, 15), 23492, 108.53, 120.46, 106.21, 116.85 }, { new DateTime(2019, 9, 16), 56127, 114.97, 118.08, 113.55, 116.69 }, { new DateTime(2019, 9, 17), 81142, 127.14, 128.23, 110.91, 117.25 }, { new DateTime(2019, 9, 18), 46384, 118.89, 120.55, 108.09, 112.52 }, { new DateTime(2019, 9, 19), 51005, 105.57, 112.58, 105.42, 109.12 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:F23"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Stock Volume-Open-High-Low-Close Chart"; GrapeCity.Documents.Excel.Drawing.IAxis valueAxis = shape.Chart.Axes.Item(GrapeCity.Documents.Excel.Drawing.AxisType.Value); GrapeCity.Documents.Excel.Drawing.IAxis categoryAxis = shape.Chart.Axes.Item(GrapeCity.Documents.Excel.Drawing.AxisType.Category); GrapeCity.Documents.Excel.Drawing.IAxis valueSecondaryAxis = shape.Chart.Axes.Item(GrapeCity.Documents.Excel.Drawing.AxisType.Value, GrapeCity.Documents.Excel.Drawing.AxisGroup.Secondary); valueAxis.MinimumScale = 0; valueAxis.MaximumScale = 150000; valueAxis.MajorUnit = 30000; categoryAxis.CategoryType = GrapeCity.Documents.Excel.Drawing.CategoryType.CategoryScale; categoryAxis.TickLabelSpacing = 5; valueSecondaryAxis.MajorUnit = 40; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:B5"].Value = new object[, ] { { null, "S1" }, { "Item1", -20 }, { "Item2", 30 }, { "Item3", 50 }, { "Item3", 40 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B5"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); GrapeCity.Documents.Excel.Drawing.ISeries series1 = shape.Chart.SeriesCollection[0]; series1.HasDataLabels = true; series1.DataLabels.ShowSeriesName = true; //set series1's all data label's format. series1.DataLabels.Format.Fill.Color.RGB = Color.Pink; series1.DataLabels.Format.Line.Color.RGB = Color.Green; series1.DataLabels.Format.Line.Weight = 1; //set series1's specific data label's format. series1.DataLabels[2].Format.Fill.Color.RGB = Color.LightGreen; series1.Points[2].DataLabel.Format.Line.Color.RGB = Color.Gray; series1.Points[2].DataLabel.Format.Line.Weight = 2; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[,] { {null, "S1", "S2", "S3"}, {"Item1", 10, 25, 25}, {"Item2", -51, -36, 27}, {"Item3", 52, -85, -30}, {"Item4", 22, 65, 65}, {"Item5", 23, 69, 69} }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); GrapeCity.Documents.Excel.Drawing.ISeries series1 = shape.Chart.SeriesCollection[0]; series1.Trendlines.Add(); series1.Trendlines[0].Type = GrapeCity.Documents.Excel.Drawing.TrendlineType.Linear; series1.Trendlines[0].Forward = 1; series1.Trendlines[0].Backward = 0.5; series1.Trendlines[0].Intercept = 2.5; series1.Trendlines[0].DisplayEquation = true; series1.Trendlines[0].DisplayRSquared = true; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:B13"].Value = new object[, ] { { "Blue Column", "Red Line" }, { 75, 20 }, { 149, 50 }, { 105, 30 }, { 55, 80 }, { 121, 40 }, { 76, 110 }, { 128, 50 }, { 114, 140 }, { 75, 60 }, { 105, 170 }, { 145, 70 }, { 110, 100 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B13"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Combination Chart"; //change series type GrapeCity.Documents.Excel.Drawing.ISeries series2 = shape.Chart.SeriesCollection[1]; series2.ChartType = GrapeCity.Documents.Excel.Drawing.ChartType.LineMarkers; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { "Item1", 10, 25, 25 }, { "Item2", -51, -36, 27 }, { "Item3", 52, -85, -30 }, { "Item4", 22, 65, 65 }, { "Item5", 23, 69, 69 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); GrapeCity.Documents.Excel.Drawing.IAxis value_axis = shape.Chart.Axes.Item(GrapeCity.Documents.Excel.Drawing.AxisType.Value); value_axis.HasMajorGridlines = true; value_axis.HasMinorGridlines = true; value_axis.MajorGridlines.Format.Line.Color.RGB = Color.Gray; value_axis.MajorGridlines.Format.Line.Weight = 1; value_axis.MinorGridlines.Format.Line.Color.RGB = Color.LightGray; value_axis.MinorGridlines.Format.Line.Weight = 0.75; value_axis.MajorUnit = 40; value_axis.MinorUnit = 8; value_axis.MinorGridlines.Format.Line.Style = GrapeCity.Documents.Excel.Drawing.LineStyle.ThickThin; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; //Create chart, chart's range is Range["G1:M21"] GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 300, 10, 300, 300); worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { "Item1", 10, 25, 25 }, { "Item2", -51, -36, 27 }, { "Item3", 52, -85, -30 }, { "Item4", 22, 65, 65 }, { "Item5", 23, 69, 69 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); //Range["G1:M21"] must contain chart's range, copy a new shape to Range["N1:T21"] worksheet.Range["G1:M21"].Copy(worksheet.Range["N1"]); //worksheet.Range["G1:M21"].Copy(worksheet.Range["N1:T21"]); //Cross sheet copy, copy a new chart to worksheet2's Range["N1:T21"] //IWorksheet worksheet2 = workbook.Worksheets.Add() //worksheet.Range["G1:M21"].Copy(worksheet2.Range["E1"]); //worksheet.Range["G1:M21"].Copy(worksheet2.Range["N1:T21"]); }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { "Item1", 10, 25, 25 }, { "Item2", -20, 36, 27 }, { "Item3", 62, 70, -30 }, { "Item4", 22, 65, 65 }, { "Item5", 23, 50, 50 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); //config chart title style with rich text shape.Chart.HasTitle = true; shape.Chart.ChartTitle.TextFrame.TextRange.Paragraphs.Add("ChartSubtitle"); shape.Chart.ChartTitle.TextFrame.TextRange.Paragraphs.Add("ChartTitle", 0); shape.Chart.ChartTitle.TextFrame.TextRange.Paragraphs[0].Font.Color.RGB = Color.CornflowerBlue; shape.Chart.ChartTitle.TextFrame.TextRange.Paragraphs[0].Font.Size = 15; shape.Chart.ChartTitle.TextFrame.TextRange.Paragraphs[1].Font.Color.RGB = Color.Orange; shape.Chart.ChartTitle.TextFrame.TextRange.Paragraphs[1].Font.Size = 10; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.AreaStacked, 250, 20, 360, 230); worksheet.Range["A1:C13"].Value = new object[, ] { { 0, 59.18, 27.14 }, { 44.64, 52.22, 25.08 }, { 45.21, 49.80, 57.99 }, { 24.32, 37.30, 42.73 }, { 58.34, 34.43, 28.34 }, { 31.89, 69.78, 46.88 }, { 41.79, 63.94, 56.24 }, { 67.94, 57.40, 27.78 }, { 49.87, 48.26, 52.06 }, { 62.39, 67.43, 33.33 }, { 54.76, 22.95, 50.36 }, { 28.33, 36.60, 36.61 }, { 22.77, 55.65, 65.64 }, { 20.34, 49.35, 45.60 }, { 32.10, 47.60, 20.62 }, { 26.37, 63.00, 53.97 }, { 35, 75, 60 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:C13"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Area Stacked Chart"; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { "Item1", 10, 25, 25 }, { "Item2", -51, 36, 27 }, { "Item3", 52, 70, -30 }, { "Item4", 22, 65, 65 }, { "Item5", 23, 69, 69 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); shape.Chart.HasLegend = true; //config legend font style GrapeCity.Documents.Excel.Drawing.ILegend legend = shape.Chart.Legend; legend.Font.Size = 12; legend.Font.Name = "Cooper Black"; //config legend format legend.Format.Fill.Color.RGB = Color.LightGray; legend.Format.Line.Color.RGB = Color.Gray; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { "Item1", 10, 25, 25 }, { "Item2", -20, 36, 27 }, { "Item3", 62, 70, -30 }, { "Item4", 22, 65, 65 }, { "Item5", 23, 50, 50 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); //config chart title style shape.Chart.HasTitle = true; shape.Chart.ChartTitle.Text = "MyChartTitle"; shape.Chart.ChartTitle.Font.Size = 15; shape.Chart.ChartTitle.Font.Name = "Bradley Hand ITC"; shape.Chart.ChartTitle.Format.Fill.Color.RGB = Color.DarkOrange; shape.Chart.ChartTitle.Format.Line.Color.RGB = Color.CornflowerBlue; shape.Chart.ChartTitle.Format.Line.Weight = 1.5; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; System.IO.Stream stream = this.GetResourceStream("logo.png"); GrapeCity.Documents.Excel.Drawing.IShape picture = worksheet.Shapes.AddPicture(stream, GrapeCity.Documents.Excel.Drawing.ImageType.PNG, 20, 20, 790, 120); }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { 1, -25, 25, 25 }, { 2, 51, 36, 27 }, { 3, 52, 80, 30 }, { 4, 22, -20, 65 }, { 5, 23, 69, 69 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); GrapeCity.Documents.Excel.Drawing.IAxis category_axis = shape.Chart.Axes.Item(GrapeCity.Documents.Excel.Drawing.AxisType.Category); GrapeCity.Documents.Excel.Drawing.IAxis value_axis = shape.Chart.Axes.Item(GrapeCity.Documents.Excel.Drawing.AxisType.Value); //config tick label's format category_axis.TickLabelPosition = GrapeCity.Documents.Excel.Drawing.TickLabelPosition.NextToAxis; category_axis.TickLabelSpacing = 2; category_axis.TickLabels.Font.Color.RGB = Color.DarkOrange; category_axis.TickLabels.Font.Size = 12; category_axis.TickLabels.NumberFormat = "#,##0.00"; value_axis.TickLabels.NumberFormat = "#,##0;[Red]#,##0"; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; worksheet.Range["A2:A6"].NumberFormat = "m/d/yyyy"; worksheet.Range["A1:D6"].Value = new object[, ] { { null, "S1", "S2", "S3" }, { new DateTime(2015, 10, 7), 10, 25, 25 }, { new DateTime(2015, 10, 24), 51, 36, 27 }, { new DateTime(2015, 11, 8), 52, 85, 30 }, { new DateTime(2015, 11, 25), 22, 65, 65 }, { new DateTime(2015, 12, 10), 23, 69, 69 } }; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); GrapeCity.Documents.Excel.Drawing.IAxis category_axis = shape.Chart.Axes.Item(GrapeCity.Documents.Excel.Drawing.AxisType.Category); category_axis.MaximumScale = new DateTime(2015, 12, 20).ToOADate(); category_axis.MinimumScale = new DateTime(2015, 10, 1).ToOADate(); category_axis.BaseUnit = GrapeCity.Documents.Excel.Drawing.TimeUnit.Months; category_axis.MajorUnitScale = GrapeCity.Documents.Excel.Drawing.TimeUnit.Months; category_axis.MajorUnit = 1; category_axis.MinorUnitScale = GrapeCity.Documents.Excel.Drawing.TimeUnit.Days; category_axis.MinorUnit = 15; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 1, 1, 200, 100); shape.Fill.PresetGradient(GrapeCity.Documents.Excel.Drawing.GradientStyle.Vertical, 3, GrapeCity.Documents.Excel.Drawing.PresetGradientType.Silver); shape.Fill.RotateWithObject = false; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 1, 1, 200, 100); shape.Fill.Solid(); shape.Fill.Color.RGB = Color.Red; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 1, 1, 200, 100); shape.Fill.Patterned(GrapeCity.Documents.Excel.Drawing.PatternType.Percent10); shape.Fill.Color.ObjectThemeColor = ThemeColor.Accent2; shape.Fill.PatternColor.ObjectThemeColor = ThemeColor.Accent6; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; //Create shape GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Rectangle, 50, 50, 200, 200); //Duplicate shape GrapeCity.Documents.Excel.Drawing.IShape newShape = shape.Duplicate(); }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; worksheet.PageSetup.Orientation = PageOrientation.Landscape; var assembly = this.GetType().GetTypeInfo().Assembly; System.IO.Stream stream = assembly.GetManifestResourceStream("GrapeCity.Documents.Excel.Examples.Resource.logo.png"); GrapeCity.Documents.Excel.Drawing.IShape picture = worksheet.Shapes.AddPicture(stream, GrapeCity.Documents.Excel.Drawing.ImageType.PNG, 20, 20, 690, 100); }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 50, 30, 200, 100); shape.ThreeD.RotationX = 50; shape.ThreeD.RotationY = 20; shape.ThreeD.RotationZ = 30; shape.ThreeD.Depth = 7; shape.ThreeD.Z = 20; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 1, 1, 200, 100); shape.Line.DashStyle = GrapeCity.Documents.Excel.Drawing.LineDashStyle.Dash; shape.Line.Style = GrapeCity.Documents.Excel.Drawing.LineStyle.Single; shape.Line.Weight = 2; shape.Line.Color.ObjectThemeColor = ThemeColor.Accent6; shape.Line.Transparency = 0.3; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; System.IO.Stream stream = this.GetResourceStream("logo.png"); //Create a shape in worksheet GrapeCity.Documents.Excel.Drawing.IShape picture = worksheet.Shapes.AddPicture(stream, GrapeCity.Documents.Excel.Drawing.ImageType.PNG, 20, 20, 395, 60); //Duplicate picture GrapeCity.Documents.Excel.Drawing.IShape newPicture = picture.Duplicate(); }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape ShapeBegin = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Rectangle, 1, 1, 100, 100); GrapeCity.Documents.Excel.Drawing.IShape EndBegin = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Rectangle, 200, 200, 100, 100); GrapeCity.Documents.Excel.Drawing.IShape ConnectorShape = worksheet.Shapes.AddConnector(GrapeCity.Documents.Excel.Drawing.ConnectorType.Straight, 1, 1, 101, 101); //connect shapes by connector shape. ConnectorShape.ConnectorFormat.BeginConnect(ShapeBegin, 3); ConnectorShape.ConnectorFormat.EndConnect(EndBegin, 0); }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 1, 1, 200, 100); shape.Fill.PresetTextured(GrapeCity.Documents.Excel.Drawing.PresetTexture.Canvas); shape.Fill.TextureAlignment = GrapeCity.Documents.Excel.Drawing.TextureAlignment.Center; shape.Fill.TextureOffsetX = 2.5; shape.Fill.TextureOffsetY = 3.2; shape.Fill.TextureHorizontalScale = 0.9; shape.Fill.TextureVerticalScale = 0.2; shape.Fill.Transparency = 0.5; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D2"].Value = new object[, ] { { 100, 200, 300, 400 }, { 100, 200, 300, 400 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D2"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Column Clustered Chart"; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet sheet = workbook.Worksheets[0]; System.IO.Stream stream = this.GetResourceStream("logo.png"); GrapeCity.Documents.Excel.Drawing.IShape picture = sheet.Shapes.AddPicture(stream, GrapeCity.Documents.Excel.Drawing.ImageType.PNG, 20, 20, 395, 60); sheet.Range["B2:D4"].Value = "Text"; sheet.PageSetup.PrintGridlines = true; //Set scaling. sheet.PageSetup.Zoom = 200; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.BarStacked, 250, 20, 360, 230); worksheet.Range["A1:C4"].Value = new object[, ] { { 103, 121, 109 }, { 56, 94, 115 }, { 116, 89, 99 }, { 55, 93, 70 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:C4"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Bar Stacked Chart"; shape.Chart.Legend.Position = GrapeCity.Documents.Excel.Drawing.LegendPosition.Left; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.Pie, 250, 20, 360, 230); worksheet.Range["A1:B4"].Value = new object[, ] { { "Blue", 1 }, { "Red", 2 }, { "Green", 3 }, { "Purple", 4 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B4"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Pie Chart"; shape.Chart.Legend.Position = GrapeCity.Documents.Excel.Drawing.LegendPosition.Right; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.BarStacked100, 250, 20, 360, 230); worksheet.Range["A1:B5"].Value = new object[, ] { { 1, 5 }, { 2, 4 }, { 3, 3 }, { 4, 2 }, { 4, 1 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B5"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Bar Stacked 100 Chart"; shape.Chart.Legend.Position = GrapeCity.Documents.Excel.Drawing.LegendPosition.Left; }
public override void Execute(GrapeCity.Documents.Excel.Workbook workbook) { IWorksheet worksheet = workbook.Worksheets[0]; //Create a shape in worksheet, shape's range is Range["A7:B7"] GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Rectangle, 1, 1, 100, 100); //Range["A1:D10"] must contain Range["A7:B7"], cut a new shape to Range["C1:F7"] worksheet.Range["A1:D10"].Cut(worksheet.Range["E1"]); //worksheet.Range["A1:D10"].Cut(worksheet.Range["E1:I9"]); //Cross sheet cut, cut a new shape to worksheet2's Range["C1:F7"] //IWorksheet worksheet2 = workbook.Worksheets.Add() //worksheet.Range["A1:D10"].Cut(worksheet2.Range["E1"]); //worksheet.Range["A1:D10"].Cut(worksheet2.Range["E1:I9"]); }