//Opens a Presentation
IPresentation presentation = Presentation.Open(@"Chart.pptx");
//Gets the first slide
ISlide slide = presentation.Slides[0];
//Gets the chart in slide
IPresentationChart chart = slide.Charts[0];
//Iterate each series in the chart
for (int i = 0; i < chart.Series.Count; i++)
{
//Get or set a value indicates whether to display a chart data label values
chart.Series[i].DataPoints.DefaultDataPoint.DataLabels.IsValue = false;
}
//Save the PowerPoint presentation presentation.Save("Output.pptx");
|
//Opens a Presentation
IPresentation presentation = Presentation.Open(@"Chart.pptx");
//Gets the first slide
ISlide slide = presentation.Slides[0];
//Gets the chart in slide
IPresentationChart chart = slide.Charts[0];
//Iterate each series in the chart
for (int i = 0; i < chart.Series.Count; i++)
{
//Get or set a value indicates whether to display a chart data label values
chart.Series[i].DataPoints.DefaultDataPoint.DataLabels.IsValue = false;
//Gets each DataPoint from the DataPoint collection foreach(IOfficeChartDataPoint dataPoint in chart.Series[i].DataPoints)
{
//Get or set a value indicates whether to display a chart data label values
dataPoint.DataLabels.IsValue = false;
}
}
//Save the PowerPoint presentation presentation.Save("Output.pptx");
|