ByteScout Barcode Suite - C# - Add surface chart with spreadsheet sdk - ByteScout

ByteScout Barcode Suite – C# – Add surface chart with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Suite – C# – Add surface chart with spreadsheet sdk

How to add surface chart with spreadsheet sdk in C# with ByteScout Barcode Suite

Continuous learning is a crucial part of computer science and this tutorial shows how to add surface chart with spreadsheet sdk in C#

The documentation is designed for a specific purpose to help you to apply the features on your side. ByteScout Barcode Suite can add surface chart with spreadsheet sdk. It can be applied from C#. ByteScout Barcode Suite is the bundle that privides 3 SDK products to generate barcodes (Barcode SDK), read barcodes (Barcode Reaer SDK) and read and write spreadsheets (Spreadsheet SDK).

The SDK samples given below describe how to quickly make your application do add surface chart with spreadsheet sdk in C# with the help of ByteScout Barcode Suite. Simply copy and paste in your C# project or application you and then run your app! Complete and detailed tutorials and documentation are available along with installed ByteScout Barcode Suite if you’d like to learn more about the topic and the details of the API.

All these programming tutorials along with source code samples and ByteScout free trial version are available for download from our website.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.Diagnostics; using Bytescout.Spreadsheet; using Bytescout.Spreadsheet.Charts; namespace CSharp { class Program { static void Main(string[] args) { // Create new Spreadsheet object Spreadsheet spreadsheet = new Spreadsheet(); spreadsheet.RegistrationName = "demo"; spreadsheet.RegistrationKey = "demo"; // Add new worksheet Worksheet sheet = spreadsheet.Workbook.Worksheets.Add("Sample"); // Add a data for Surface chart int count = 10; double step = 2 * Math.PI / (count - 1); for (int i = 0; i < count; i++) for (int j = 0; j < count; j++) sheet[i, j].Value = Math.Sin(step * Math.Sqrt(i * i + j * j)); // Add charts to worksheet Chart surfaceChart = sheet.Charts.AddChartAndFitInto(11, 1, 28, 8, ChartType.Surface); for (int i = 0; i < count; i++) surfaceChart.SeriesCollection.Add(new Series(sheet.Range(0, i, 9, i))); surfaceChart = sheet.Charts.AddChartAndFitInto(11, 10, 28, 17, ChartType.SurfaceWireframe); for (int i = 0; i < count; i++) surfaceChart.SeriesCollection.Add(new Series(sheet.Range(0, i, 9, i))); surfaceChart = sheet.Charts.AddChartAndFitInto(29, 1, 46, 8, ChartType.SurfaceTopView); for (int i = 0; i < count; i++) surfaceChart.SeriesCollection.Add(new Series(sheet.Range(0, i, 9, i))); surfaceChart = sheet.Charts.AddChartAndFitInto(29, 10, 46, 17, ChartType.SurfaceTopViewWireframe); for (int i = 0; i < count; i++) surfaceChart.SeriesCollection.Add(new Series(sheet.Range(0, i, 9, i))); // Save it as XLS spreadsheet.SaveAs("Output.xls"); // Close the document spreadsheet.Close(); // Open generated XLS file in default associated application Process.Start("Output.xls"); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next