AxisBuiltInUnit Enumeration

Specifies the display units for an axis.

Namespace:  Aspose.Words.Drawing.Charts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public enum AxisBuiltInUnit
Members
  Member nameValueDescription
None0 Specifies the values on the chart shall displayed as is.
Custom1 Specifies the values on the chart shall be divided by a user-defined divisor. This value is not supported by the new chart types of MS Office 2016.
Billions2 Specifies the values on the chart shall be divided by 1,000,000,000.
HundredMillions3 Specifies the values on the chart shall be divided by 100,000,000.
Hundreds4 Specifies the values on the chart shall be divided by 100.
HundredThousands5 Specifies the values on the chart shall be divided by 100,000.
Millions6 Specifies the values on the chart shall be divided by 1,000,000.
TenMillions7 Specifies the values on the chart shall be divided by 10,000,000.
TenThousands8 Specifies the values on the chart shall be divided by 10,000.
Thousands9 Specifies the values on the chart shall be divided by 1,000.
Trillions10 Specifies the values on the chart shall be divided by 1,000,000,000,0000.
Percentage11 Specifies the values on the chart shall be divided by 0.01. This value is supported only by the new chart types of MS Office 2016.
Examples
Shows how to manipulate the tick marks and displayed values of a chart axis.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a scatter chart, which is populated by default values
Shape shape = builder.InsertChart(ChartType.Scatter, 450, 250);
Chart chart = shape.Chart;

// Set they Y axis to show major ticks every at every 10 units and minor ticks at every 1 units
ChartAxis axis = chart.AxisY;
axis.MajorTickMark = AxisTickMark.Outside;
axis.MinorTickMark = AxisTickMark.Outside;

axis.MajorUnit = 10.0;
axis.MinorUnit = 1.0;

// Stretch out the bounds of the axis out to show 3 major ticks and 27 minor ticks
axis.Scaling.Minimum = new AxisBound(-10);
axis.Scaling.Maximum = new AxisBound(20);

// Do the same for the X-axis
axis = chart.AxisX;
axis.MajorTickMark = AxisTickMark.Inside;
axis.MinorTickMark = AxisTickMark.Inside;
axis.MajorUnit = 10.0;
axis.Scaling.Minimum = new AxisBound(-10);
axis.Scaling.Maximum = new AxisBound(30);

// We can also use this attribute to set minor tick spacing
axis.TickLabelSpacing = 2;
// We can define text alignment when axis tick labels are multi-line
// MS Word aligns them to the center by default
axis.TickLabelAlignment = ParagraphAlignment.Right;

// Get the axis to display values, but in millions
axis.DisplayUnit.Unit = AxisBuiltInUnit.Millions;

// Besides the built-in axis units we can choose from,
// we can also set the axis to display values in some custom denomination, using the following attribute
// The statement below is equivalent to the one above
axis.DisplayUnit.CustomUnit = 1000000.0;

doc.Save(ArtifactsDir + "Charts.ChartAxisDisplayUnit.docx");
See Also