Hi there,
I want to set the values in percentage and number(thousands separator) for the axis values and data points up to 1 precision after decimal point.
using the below code , I am able to set the values in percentage and number(thousands separator) for the axis values and data points but up to 2 precision after decimal point.
So I want to assign some custom format to achieve the same up to 1 precision after decimal point.
Code:
chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 0, 0, chartSeries.SeriesTitle), ac.ChartType.ClusteredColumn);
IChartSeries series = chart.ChartData.Series[seriesNo];
foreach (ac.IChartDataPoint dp in series.DataPoints)
{
IDataLabel dataLabel = dp.Label;
dataLabel.DataLabelFormat.ShowValue = true;
if (seriesDataType.Contains(“number”))
{
dp.Value.AsCell.PresetNumberFormat = 4;
} }
else if (seriesDataType.Contains(“percent”))
{
dp.Value.AsCell.PresetNumberFormat = 10; // 0.00%
}
}
How can we give custom number format instead of “PresetNumberFormat”? Please help.
Thanks in advance.