Aspose.Cells.Examples.CSharp.Articles.CustomTextForLabels.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:UsingGlobalizationSettings
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            // Loads an existing spreadsheet containing a pie chart
            Workbook book = new Workbook(dataDir + "sample.xlsx");

            // Assigns the GlobalizationSettings property of the WorkbookSettings class to the class created in first step
            book.Settings.GlobalizationSettings = new CustomSettings();

            // Accesses the 1st worksheet from the collection which contains pie chart
            Worksheet sheet = book.Worksheets[0];

            // Accesses the 1st chart from the collection
            Chart chart = sheet.Charts[0];

            // Refreshes the chart
            chart.Calculate();

            // Renders the chart to image
            chart.ToImage(dataDir + "output_out.png", new ImageOrPrintOptions());
            // ExEnd:UsingGlobalizationSettings
        }
CustomTextForLabels