Clear chart and set only title


#1

Hi,
As per my requirement i need to clear out everything in the chart and just set a chart title.

I am clearing all the series, categories and chartdata workbook and then setting the chart title but it generates an empty shape without any chart title.

Please find attached the source and output file and also
Below is my code
using (Presentation sourcePresentation = new Presentation(dataDir + “Aspos_Source_Issue_ClearData.pptx”))
{
var sourceSlides = sourcePresentation.Slides;

            var generatedPres = new Presentation();
            generatedPres.Slides.RemoveAt(0);
            generatedPres.Masters.RemoveUnused(true);
            generatedPres.ViewProperties.SlideViewProperties.Scale = sourcePresentation.ViewProperties.SlideViewProperties.Scale;

            var mainPage = generatedPres.Slides.InsertClone(0, sourceSlides[0]);

            var chart = (Chart) mainPage.Shapes[0];
            chart.ChartData.Categories.Clear();
            chart.ChartData.Series.Clear();
            chart.ChartData.ChartDataWorkbook.Clear(0);
            if (chart.ChartTitle.TextFrameForOverriding != null)
            {
                chart.ChartTitle.TextFrameForOverriding.Text = "No Data available";
            }
            else
            {
                chart.ChartTitle.AddTextFrameForOverriding("No Data available");
                chart.ChartTitle.TextFrameForOverriding.TextFrameFormat.CenterText = NullableBool.True;
                chart.ChartTitle.Height = 20;
                chart.HasTitle = true;
            }



            // Save presentation    
            generatedPres.Save(dataDir + "Aspose_Output_Issue_ClearData.pptx", SaveFormat.Pptx);
            Console.WriteLine("Presentation Created");
        }

Content.zip (87.9 KB)


#2

@siddhanntarora,

I have observed the issue shared by you and have been able to reproduce the issue specified. An issue with ID SLIDESNET-39684 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.


#3

@Adnan.Ahmad,

Any update on this, or can you suggest a workaround so that all the chart data clears out and only tiltle is displayed?


#4

@siddhanntarora,

I have observed your comments. Our product team is looking into this to provide you some workaround or to resolve this issue as soon as possible. I request for your patience until further feedback is shared by product team.


#5

@siddhanntarora,

Can you please share Power Point presentation with desired result so that we may investigate further to help you out.


#6

@siddhanntarora,

Can you please share if you have still issue or can we close this ticket if your issue has been resolved.