//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.LineMarkers, 250, 20, 360, 230); worksheet.Range["A1:B6"].Value = new object[,] { {null, "S1"}, {"Item1", 10}, {"Item2", -51}, {"Item3", 52}, {"Item4", 22}, {"Item5", 40} }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); GrapeCity.Documents.Excel.Drawing.ISeries series1 = shape.Chart.SeriesCollection[0]; //config line markers style series1.MarkerFormat.Fill.Color.RGB = Color.CornflowerBlue; series1.MarkerFormat.Line.Style = GrapeCity.Documents.Excel.Drawing.LineStyle.ThickThin; series1.MarkerFormat.Line.Color.RGB = Color.LightGreen; series1.MarkerFormat.Line.Weight = 3; // Save to an excel file workbook.Save("ConfigMarkersFormat.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim shape As IShape = worksheet.Shapes.AddChart(ChartType.LineMarkers, 250, 20, 360, 230) worksheet.Range("A1:B6").Value = New Object(,) { {Nothing, "S1"}, {"Item1", 10}, {"Item2", -51}, {"Item3", 52}, {"Item4", 22}, {"Item5", 40} } shape.Chart.SeriesCollection.Add(worksheet.Range("A1:B6"), RowCol.Columns, True, True) Dim series1 As ISeries = shape.Chart.SeriesCollection(0) 'config line markers style series1.MarkerFormat.Fill.Color.RGB = Color.CornflowerBlue series1.MarkerFormat.Line.Style = LineStyle.ThickThin series1.MarkerFormat.Line.Color.RGB = Color.LightGreen series1.MarkerFormat.Line.Weight = 3 ' save to an excel file workbook.Save("ConfigMarkersFormat.xlsx")