ByteScout Data Extraction Suite - C# - Add surface chart with spreadsheet sdk - ByteScout

ByteScout Data Extraction Suite – C# – Add surface chart with spreadsheet sdk

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

How to add surface chart with spreadsheet sdk in C# using ByteScout Data Extraction Suite

Learn to code in C# to add surface chart with spreadsheet sdk with this step-by-step tutorial

The sample source codes on this page shows how to add surface chart with spreadsheet sdk in C#. Want to add surface chart with spreadsheet sdk in your C# app? ByteScout Data Extraction Suite is designed for it. ByteScout Data Extraction Suite is the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.

These C# code samples for C# guide developers to speed up coding of the application when using ByteScout Data Extraction Suite. This C# 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! This basic programming language sample code for C# will do the whole work for you to add surface chart with spreadsheet sdk.

Trial version of ByteScout Data Extraction Suite is available for free. Source code samples are included to help you with your C# app.

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 Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction 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 Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next