Syncfusion.XlsIO.Base
Example 


TreeMapLabelOption Property (IChartSerieDataFormat)

Gets / Sets the Display label position in Tree map chart
Syntax
'Declaration
 
Property TreeMapLabelOption As ExcelTreeMapLabelOption
'Usage
 
Dim instance As IChartSerieDataFormat
Dim value As ExcelTreeMapLabelOption
 
instance.TreeMapLabelOption = value
 
value = instance.TreeMapLabelOption
ExcelTreeMapLabelOption TreeMapLabelOption {get; set;}
Example
For ExcelChartType.TreeMap chart by default TreeMapLabelOption is set to ExcelTreeMapLabelOption.Overlapping. Here for example, we set ExcelTreeMapLabelOption.Banner to TreeMapLabelOption.
using Syncfusion.XlsIO;
            
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 = "Fall";
            sheet.Range["B1"].Text = "Month";
            sheet.Range["C1"].Text = "Total";
            sheet.Range["A2:A4"].Text = "Quarter1";
            sheet.Range["A5:A7"].Text = "Quarter2";
            sheet.Range["B2"].Text = "Jan";
            sheet.Range["B3"].Text = "Feb";
            sheet.Range["B4"].Text = "Mar";
            sheet.Range["B5"].Text = "Apr";
            sheet.Range["B6"].Text = "May";
            sheet.Range["B7"].Text = "Jun";
            sheet.Range["C2"].Value = "10";
            sheet.Range["C3"].Value = "20";
            sheet.Range["C4"].Value = "30";
            sheet.Range["C5"].Value = "35";
            sheet.Range["C6"].Value = "25";
            sheet.Range["C7"].Value = "15";
            
            //Create chart
            IChart chart = sheet.Charts.Add();
            
            //Set chart type
            chart.ChartType = ExcelChartType.TreeMap;
            
            //Set range
            chart.DataRange = sheet.Range["A1:C7"];
            
            //Set chart format
            IChartSerieDataFormat format = chart.Series[0].SerieFormat;
            
            //Set label option
            format.TreeMapLabelOption = ExcelTreeMapLabelOption.Banner;
            
            //Save and Dispose
            workbook.SaveAs("Chart.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also