public void AddChartTitle(PPT.Chart chart, ChartTitle chartTitle)
 {
     chart.HasTitle = true;
     chart.ChartTitle.Text = chartTitle.titleText;
     chart.ChartTitle.Font.Italic = chartTitle.italic;
     chart.ChartTitle.Font.Bold = chartTitle.bold;
     chart.ChartTitle.Font.Underline = chartTitle.underline;
     chart.ChartTitle.Font.Size = chartTitle.fontSize;
     chart.Refresh();
 }
예제 #2
0
        protected override void When()
        {
            ChartTitle chartTitle = new ChartTitle()
            {
                bold      = true,
                italic    = true,
                fontSize  = 22,
                titleText = "test title",
                underline = true
            };

            this.SUT.AddChartTitle(returnedChart, chartTitle);
        }
        private static void DecorateSlideThree(PPT.Slide slide)
        {
            var columnsList = new string[] { "C#", "VB.Net", "Perl", "Python", "Java" };

            var series1 = new ChartSeries()
                              {
                                      name = "Blog Statistics",
                                      seriesData = new string[] { "8200", "3900", "890", "300", "3278" },
                                      seriesType = XlChartType.xl3DColumn
                              };

            var chartData = new List<ChartSeries>() { series1 };
            var chart = PptChartManager.CreateChart(XlChartType.xlColumnStacked, slide, columnsList, chartData);

            var chartTitle = new ChartTitle()
                                 {
                                         bold = true,
                                         italic = false,
                                         fontSize = 40,
                                         titleText = "Users by Software Language",
                                         underline = false
                                 };

            PptChartManager.AddChartTitle(chart, chartTitle);
            SetSlideFooter(slide, 3);
        }