Chart Data Label
Set Precision of Data in Chart Data Label
Aspose.Slides for C++ provides a simple API for setting precision of data in chart data label. Below sample example is given.
Display Percentage as Labels
Aspose.Slides for C++ supports displaying the percentage as labels. In this topic, we will see with an example of how to display the percentage as labels using Aspose.Slides. In order to set percentage as a display. Please follow the steps below.
- Instantiate Presentation object.
- Add a stacked column chart.
- Calculate the series data point values for particular categories.
- Displaying the percentage as labels.
- Set properties of label.
- Write a presentation to disk.
In the example given below, we have set the percentage as a label.
Set Percentage Sign with Chart Data Label
In order to set the percentage sign with chart data labels. Please follow the steps below:
- Create an instance of Presentation class.
- Get the reference of the slide.
- Add PercentsStackedColumn chart on a slide.
- Set NumberFormatLinkedToSource to false.
- Getting the chart data worksheet.
- Add a new series.
- Setting the fill color of series.
- Setting LabelFormat properties.
- Write the presentation as a PPTX file.
Set Label Distances
In order to set the Label Distance. Please follow the steps below:
- Create an instance of Presentation class.
- Get the reference of the slide.
- Adding a chart on slide.
- Setting the position of a label from axis.
- Write the presentation as a PPTX file.
In the example given below, we have set the label distance from category axis.