SettableChartGlobalizationSettings.GetChartTitleName

SettableChartGlobalizationSettings.GetChartTitleName method

Gets the name of Chart Title.

public override string GetChartTitleName()

Examples

namespace AsposeCellsExamples
{
    using Aspose.Cells;
    using System;

    public class SettableChartGlobalizationSettingsMethodGetChartTitleNameDemo
    {
        public static void Run()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add minimal data for context
            worksheet.Cells["A1"].Value = "Sample Data";

            try
            {
                // Create an instance of SettableChartGlobalizationSettings
                SettableChartGlobalizationSettings settings = new SettableChartGlobalizationSettings();

                // Set a custom chart title name
                settings.SetChartTitleName("Custom Chart Title");

                // Get the chart title name using GetChartTitleName
                string chartTitleName = settings.GetChartTitleName();

                // Display the result
                Console.WriteLine("Chart Title Name: " + chartTitleName);

                // Save the workbook
                workbook.Save("GetChartTitleNameDemo.xlsx");
                Console.WriteLine("Workbook saved successfully.");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error calling GetChartTitleName: {ex.Message}");
            }
        }
    }
}

See Also