Syncfusion.XlsIO.Base
Example 


NameRange Property (IChartSerie)

Gets or sets the series name range.
Syntax
'Declaration
 
ReadOnly Property NameRange As IRange
'Usage
 
Dim instance As IChartSerie
Dim value As IRange
 
value = instance.NameRange
IRange NameRange {get;}
Example
The following code illustrates how to access the name range of a particular IChartSerie in the IChartSeries collection.
using Syncfusion.XlsIO;
using System;
            
class Program
{
    static void Main(string[] args)
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet sheet = workbook.Worksheets[0];
            
            //Add data
            sheet.Range["A1"].Text = "Width";
            sheet.Range["A2"].Text = "Height";
            sheet.Range["B1"].Value = "50";
            sheet.Range["C1"].Value = "60";
            sheet.Range["D1"].Value = "5";
            sheet.Range["B2"].Value = "1";
            sheet.Range["C2"].Value = "4";
            sheet.Range["D2"].Value = "2";
            
            //Create chart
            IChart chart = sheet.Charts.Add();
            
            //Set chart type
            chart.ChartType = ExcelChartType.Bubble;
            
            //Set range
            chart.DataRange = sheet["A1:D2"];
            
            //Get name range
            Console.Write(chart.Series[0].NameRange.AddressLocal);
            
            //Save and Dispose
            workbook.SaveAs("Chart.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//A1
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also