//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:B8"].Value = new object[,] { { 6, 55 }, { 45, 25 }, { 35, 45 }, { 25, 65 }, { 65, 15 }, { 45, 75 }, { 75, 55 }, { 65, 35 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B8"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Line with Markers"; shape.Chart.SeriesCollection[0].MarkerStyle = GrapeCity.Documents.Excel.Drawing.MarkerStyle.Square; // Save to an excel file workbook.Save("LineMarkersChart.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:B8").Value = New Object(,) { {6, 55}, {45, 25}, {35, 45}, {25, 65}, {65, 15}, {45, 75}, {75, 55}, {65, 35} } shape.Chart.SeriesCollection.Add(worksheet.Range("A1:B8"), RowCol.Columns) shape.Chart.ChartTitle.Text = "Line with Markers" shape.Chart.SeriesCollection(0).MarkerStyle = MarkerStyle.Square ' save to an excel file workbook.Save("LineMarkersChart.xlsx")