Aspose.Slides For .NET V19.2.0
LINK > https://urluso.com/2tuUc5
What's New in Aspose.Slides for .NET v19.2.0
Aspose.Slides for .NET is a powerful and versatile library that allows you to create, manipulate, and convert PowerPoint presentations programmatically. With Aspose.Slides for .NET, you can access and modify presentation elements such as slides, shapes, tables, charts, animations, multimedia, and more without requiring Microsoft PowerPoint.
In this article, we will explore some of the new features and enhancements that are introduced in Aspose.Slides for .NET v19.2.0. This version includes several bug fixes and improvements that make the API more stable and reliable.
Support for Custom Data Labels in Charts
One of the new features in Aspose.Slides for .NET v19.2.0 is the support for custom data labels in charts. Data labels are used to display additional information about the data points in a chart, such as values, percentages, or names. With Aspose.Slides for .NET, you can now customize the appearance and position of data labels in various chart types, such as pie, doughnut, bar, column, line, area, and scatter.
To use custom data labels in charts, you need to access the IDataLabelFormat interface that provides various properties and methods to modify the data labels. For example, you can use the ShowValue, ShowCategoryName, ShowSeriesName, and ShowPercentage properties to specify which information to display in the data labels. You can also use the Position property to set the position of the data labels relative to the data points.
The following code snippet shows how to create a pie chart with custom data labels using Aspose.Slides for .NET:
// Create a presentation
using (Presentation pres = new Presentation())
{
// Add a slide
ISlide slide = pres.Slides[0];
// Add a chart
IChart chart = slide.Shapes.AddChart(ChartType.Pie, 50, 50, 400, 400);
// Get the chart data
IChartData chartData = chart.ChartData;
// Add categories and series
IChartDataWorkbook workbook = chartData.ChartDataWorkbook;
chartData.Categories.Add(workbook.GetCell(0, \"A1\", \"Category 1\"));
chartData.Categories.Add(workbook.GetCell(0, \"A2\", \"Category 2\"));
chartData.Categories.Add(workbook.GetCell(0, \"A3\", \"Category 3\"));
IChartSeries series = chartData.Series[0];
series.DataPoints.AddDataPointForPieSeries(workbook.GetCell(0, \"B1\", 40));
series.DataPoints.AddDataPointForPieSeries(workbook.GetCell(0, \"B2\", 30));
series.DataPoints.AddDataPointForPieSeries(workbook.GetCell(0, \"B3\", 30));
// Enable custom data labels
series.Labels.DefaultDataLabelFormat.ShowValue = true;
series.Labels.DefaultDataLabelFormat.ShowCategoryName = true;
series.Labels.DefaultDataLabelFormat.ShowPercentage = true;
series.Labels.DefaultDataLabelFormat.Position = LegendDataLabelPosition.InsideEnd;
// Save the presentation
pres.Save(\"output.pptx\", SaveFormat.Pptx);
}
Improved Rendering of Text Boxes and Tables
Another improvement in Aspose.Slides for .NET v19.2.0 is the enhanced rendering of text boxes and tables in various output formats. Text boxes and tables are common elements in PowerPoint presentations that are used to display text and data in a structured way. With Aspose.Slides for .NET, you can render text boxes and tables to PDF, XPS, SVG, HTML, and image formats with high fidelity and accuracy.
In this version, several issues related to text alignment, wrapping, spacing, font size, and color have been fixed. Moreover, some bugs related to table borders, cell margins, background fill, and text direction have been resolved. These fixes improve the quality and consistency of the rendered output across different formats.
The following code snippet shows how to render ec8f644aee