PercentOptions Class
Provides settings for presenting point values as percents.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.dll
NuGet Package: DevExpress.Charts
Declaration
[TypeConverter(typeof(PercentOptionsTypeConverter))]
public class PercentOptions :
ChartElement
Related API Members
The following members return PercentOptions objects:
Remarks
The PercentOptions class allows you to control whether point values should be presented as percents (see the PercentOptions.ValueAsPercent property) and specify the accuracy of percent values (see the PercentOptions.PercentageAccuracy property).
An object of the PercentOptions type is available via the FullStackedPointOptions.PercentOptions or SimplePointOptions.PercentOptions properties.
Example
This example demonstrates how to make series point labels of a pie chart show their values as percentages.
Note that to achieve this at runtime, you should cast the series’ SeriesBase.PointOptions to the PiePointOptions type.
// Make the series points' values to be displayed as percents.
((PiePointOptions)series1.PointOptions).PercentOptions.ValueAsPercent = true;
((PiePointOptions)series1.PointOptions).ValueNumericOptions.Format = NumericFormat.Percent;
((PiePointOptions)series1.PointOptions).ValueNumericOptions.Precision = 0;