ChartNumberFormat Class
Represents number formatting of the parent element.
Inheritance Hierarchy
SystemObject
  Aspose.Words.Drawing.ChartsChartNumberFormat

Namespace: Aspose.Words.Drawing.Charts
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
Syntax
public class ChartNumberFormat

The ChartNumberFormat type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleFormatCode
Gets or sets the format code applied to a data label.
Public propertyCode exampleIsLinkedToSource
Specifies whether the format code is linked to a source cell. Default is true.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to set formatting for chart values.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert chart
Shape shape = builder.InsertChart(ChartType.Column, 432, 252);
Chart chart = shape.Chart;

// Clear demo data
chart.Series.Clear();

chart.Series.Add("Aspose Test Series",
    new string[] { "Word", "PDF", "Excel", "GoogleDocs", "Note" },
    new double[] { 1900000, 850000, 2100000, 600000, 1500000 });

// Set number format
chart.AxisY.NumberFormat.FormatCode = "#,##0";

// Set this to override the above value and draw the number format from the source cell
Assert.False(chart.AxisY.NumberFormat.IsLinkedToSource);
See Also