[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IDataLabel.NumberFormat

NumberFormat Property

NumberFormat

Gets or sets the number format code used by the data label.

This property returns the format code currently applied to the label value. If the label does not define its own number format, it can use the inherited format from its parent data labels. When no custom format is available, this method returns "General".

Declaration
string NumberFormat { get; set; }
Property NumberFormat As String
Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Month", "Sales"},
    {"Jan", 10},
    {"Feb", 20}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 300, 200).Chart;
chart.SeriesCollection.Add(worksheet.Range["A1:B3"], RowCol.Columns);
IDataLabel dataLabel = chart.SeriesCollection[0].Points[0].DataLabel;
dataLabel.NumberFormat = "$#,##0.00";
string numberFormat = dataLabel.NumberFormat;