The sample source code below will teach you how to add combination chart in VB.NET. ByteScout Spreadsheet SDK can add combination chart. It can be used from VB.NET. ByteScout Spreadsheet SDK is the SDK to create, read, modify and calculate spreadsheets. Formula calculations are supported, import and export to and from JSON, CSV, XML, databases, arrays.
This rich sample source code in VB.NET for ByteScout Spreadsheet SDK includes the number of functions and options you should do calling the API to add combination chart. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Detailed tutorials and documentation are available along with installed ByteScout Spreadsheet SDK if you’d like to dive deeper into the topic and the details of the API.
Download free trial version of ByteScout Spreadsheet SDK from our website with this and other source code samples for VB.NET.
Imports Bytescout.Spreadsheet Imports Bytescout.Spreadsheet.Charts Module Module1 Sub Main() ' Create new Spreadsheet object Dim spreadsheet As New Spreadsheet() spreadsheet.RegistrationName = "demo" spreadsheet.RegistrationKey = "demo" ' Add new worksheet Dim sheet As Worksheet = spreadsheet.Workbook.Worksheets.Add("Sample") ' Add few random numbers Dim length As Integer = 10 Dim rnd As New Random() For i As Integer = 0 To length - 1 sheet.Cell(i, 0).Value = rnd.[Next](10) sheet.Cell(i, 1).Value = rnd.[Next](10) Next ' Add charts to worksheet Dim columnChart As Chart = sheet.Charts.AddChart(5, 4, ChartType.ColumnClustered) columnChart.SeriesCollection.Add(New Series(sheet.Range(0, 0, 9, 0))) Dim series As New Series(sheet.Range(0, 1, 9, 1)) series.ChartType = ChartType.Line columnChart.SeriesCollection.Add(series) ' Save it as XLS spreadsheet.SaveAs("Output.xls") ' Close the document spreadsheet.Close() ' Cleanup spreadsheet.Dispose() ' Open generated XLS file in default associated application Process.Start("Output.xls") End Sub End Module