Aspose.Slides.Examples.CSharp.Charts.ChangeChartCategoryAxis.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Charts();

            using (Presentation presentation = new Presentation(dataDir + "ExistingChart.pptx"))
            {
                IChart chart = presentation.Slides[0].Shapes[0] as IChart;
                chart.Axes.HorizontalAxis.CategoryAxisType = CategoryAxisType.Date;
                chart.Axes.HorizontalAxis.IsAutomaticMajorUnit = false;
                chart.Axes.HorizontalAxis.MajorUnit = 1;
                chart.Axes.HorizontalAxis.MajorUnitScale = TimeUnitType.Months;
                presentation.Save(dataDir + "ChangeChartCategoryAxis_out.pptx", SaveFormat.Pptx);
            }
        }
    }
ChangeChartCategoryAxis