ChartAxisNumberFormat Property

Returns a ChartNumberFormat object that allows defining number formats for the axis.

Namespace:  Aspose.Words.Drawing.Charts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.8.0


public ChartNumberFormat NumberFormat { get; }

Property Value

Type: ChartNumberFormat


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 and replace it with a new custom chart series
chart.Series.Add("Aspose Test Series",
    new string[] { "Word", "PDF", "Excel", "GoogleDocs", "Note" },
    new double[] { 1900000.0d, 850000.0d, 2100000.0d, 600000.0d, 1500000.0d });

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

// Set this to override the above value and draw the number format from the source cell

doc.Save(ArtifactsDir + "Charts.SetNumberFormatToChartAxis.docx");

See Also