Public API and Backwards Incompatible Changes in Aspose.Slides for .NET 14.6.0
Contents
[
Hide
]
This page lists all added classes, methods, properties and so on, any new restrictions and other changes introduced with the Aspose.Slides for .NET 14.6.0 API.
Public API Changes
Added Interfaces, Methods and Properties
Added the Aspose.Slides.Charts.IErrorBarsFormat Interface
This represents error bars of chart series.
In case of custom value type, to specify a value, use the ErrorBarCustomValues property of the specific data point in the DataPoints collection of series.
using (Presentation pres = new Presentation())
{
IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Bubble, 50, 50, 400, 300, true);
IErrorBarsFormat errBarX = chart.ChartData.Series[0].ErrorBarsXFormat;
IErrorBarsFormat errBarY = chart.ChartData.Series[0].ErrorBarsYFormat;
errBarX.IsVisible = true;
errBarY.IsVisible = true;
errBarX.ValueType = ErrorBarValueType.Fixed;
errBarX.Value = 0.1f;
errBarY.ValueType = ErrorBarValueType.Percentage;
errBarY.Value = 5;
errBarX.Type = ErrorBarType.Plus;
errBarY.Format.Line.Width = 2;
errBarX.HasEndCap = true;
pres.Save("ErrorBars.pptx", SaveFormat.Pptx);
}
Added the Aspose.Slides.Charts.IErrorBarsCustomValues Interface
When the IErrorBarsFormat.ValueType property is equal to Custom, to specify a value, use the ErrorBarCustomValues property of the specific data point in the DataPoints collection.
using (Presentation pres = new Presentation())
{
IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Bubble, 50, 50, 400, 300, true);
IChartSeries series = chart.ChartData.Series[0];
IErrorBarsFormat errBarX = series.ErrorBarsXFormat;
IErrorBarsFormat errBarY = series.ErrorBarsYFormat;
errBarX.IsVisible = true;
errBarY.IsVisible = true;
errBarX.ValueType = ErrorBarValueType.Custom;
errBarY.ValueType = ErrorBarValueType.Custom;
IChartDataPointCollection points = series.DataPoints;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForXPlusValues = DataSourceType.DoubleLiterals;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForXMinusValues = DataSourceType.DoubleLiterals;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForYPlusValues = DataSourceType.DoubleLiterals;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForYMinusValues = DataSourceType.DoubleLiterals;
for (int i = 0; i < points.Count; i++)
{
points[i].ErrorBarsCustomValues.XMinus.AsLiteralDouble = i + 1;
points[i].ErrorBarsCustomValues.XPlus.AsLiteralDouble = i + 1;
points[i].ErrorBarsCustomValues.YMinus.AsLiteralDouble = i + 1;
points[i].ErrorBarsCustomValues.YPlus.AsLiteralDouble = i + 1;
}
pres.Save("ErrorBarsCustomValues", SaveFormat.Pptx);
}
Added the Aspose.Slides.Charts.IDataSourceTypeForErrorBarsCustomValues Interface
Specifies types of values in the ChartDataPoint.ErrorBarsCustomValues properties list.
using (Presentation pres = new Presentation())
{
IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Bubble, 50, 50, 400, 300, true);
IChartSeries series = chart.ChartData.Series[0];
IErrorBarsFormat errBarX = series.ErrorBarsXFormat;
IErrorBarsFormat errBarY = series.ErrorBarsYFormat;
errBarX.IsVisible = true;
errBarY.IsVisible = true;
errBarX.ValueType = ErrorBarValueType.Custom;
errBarY.ValueType = ErrorBarValueType.Custom;
IChartDataPointCollection points = series.DataPoints;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForXPlusValues = DataSourceType.DoubleLiterals;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForXMinusValues = DataSourceType.DoubleLiterals;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForYPlusValues = DataSourceType.DoubleLiterals;
points.DataSourceTypeForErrorBarsCustomValues.DataSourceTypeForYMinusValues = DataSourceType.DoubleLiterals;
for (int i = 0; i < points.Count; i++)
{
points[i].ErrorBarsCustomValues.XMinus.AsLiteralDouble = i + 1;
points[i].ErrorBarsCustomValues.XPlus.AsLiteralDouble = i + 1;
points[i].ErrorBarsCustomValues.YMinus.AsLiteralDouble = i + 1;
points[i].ErrorBarsCustomValues.YPlus.AsLiteralDouble = i + 1;
}
pres.Save("ErrorBarsCustomValues", SaveFormat.Pptx);
}
Added the Aspose.Slides.IShapeCollection.AddClone(…), and .InsertClone(…) Methods
The following methods add/insert a copy of a specified shape into the collection.
- Aspose.Slides.IShapeCollection.AddClone(IShape sourceShape)
- Aspose.Slides.IShapeCollection.AddClone(IShape sourceShape, float x, float y)
- Aspose.Slides.IShapeCollection.AddClone(IShape sourceShape, float x, float y, float width, float height)
- Aspose.Slides.IShapeCollection.InsertClone(int index, IShape sourceShape)
- Aspose.Slides.IShapeCollection.InsertClone(int index, IShape sourceShape, float x, float y)
- Aspose.Slides.IShapeCollection.InsertClone(int index, IShape sourceShape, float x, float y, float width, float height)
using (Presentation srcPres = new Presentation(dataPath_ShapeCloning + "Source Frame.pptx"))
{
IShapeCollection sourceShapes = srcPres.Slides[0].Shapes;
ILayoutSlide blankLayout = srcPres.Masters[0].LayoutSlides.GetByType(SlideLayoutType.Blank);
ISlide destSlide = srcPres.Slides.AddEmptySlide(blankLayout);
IShapeCollection destShapes = destSlide.Shapes;
destShapes.AddClone(sourceShapes[1], 50, 150 + sourceShapes[0].Height);
destShapes.AddClone(sourceShapes[2]);
destShapes.AddClone(sourceShapes[3], 50, 200, 50, 50);
destShapes.AddClone(sourceShapes[4]);
destShapes.AddClone(sourceShapes[5], 300, 300, 50, 200);
destShapes.InsertClone(0, sourceShapes[0], 50, 150);
}
Added the ViewType enum, IViewProperties interface, ViewProperties class and IPresentation.ViewProperties Properties
The IPresentation.ViewProperty allows developers to change the presentation view type and notes visibility when a presentation is opened in PowerPoint.
using(Presentation p = new Presentation())
{
p.ViewProperties.LastView = ViewType.SlideMasterView;
}