AxisBuiltInUnit enumeration

AxisBuiltInUnit enumeration

Specifies the display units for an axis.

Members

NameDescription
NONESpecifies the values on the chart shall displayed as is.
CUSTOMSpecifies 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.
BILLIONSSpecifies the values on the chart shall be divided by 1,000,000,000.
HUNDRED_MILLIONSSpecifies the values on the chart shall be divided by 100,000,000.
HUNDREDSSpecifies the values on the chart shall be divided by 100.
HUNDRED_THOUSANDSSpecifies the values on the chart shall be divided by 100,000.
MILLIONSSpecifies the values on the chart shall be divided by 1,000,000.
TEN_MILLIONSSpecifies the values on the chart shall be divided by 10,000,000.
TEN_THOUSANDSSpecifies the values on the chart shall be divided by 10,000.
THOUSANDSSpecifies the values on the chart shall be divided by 1,000.
TRILLIONSSpecifies the values on the chart shall be divided by 1,000,000,000,0000.
PERCENTAGESpecifies 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.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_chart(chart_type=ChartType.SCATTER, width=450, height=250)
chart = shape.chart
self.assertEqual(1, chart.series.count)
self.assertEqual('Y-Values', chart.series[0].name)
# Set Y-axis tick marks and units
axis = chart.axis_y
axis.major_tick_mark = AxisTickMark.CROSS
axis.minor_tick_mark = AxisTickMark.OUTSIDE
axis.major_unit = 10
axis.minor_unit = 1
axis.scaling.minimum = AxisBound(value=-10)
axis.scaling.maximum = AxisBound(value=20)
# Set X-axis tick marks and units
axis = chart.axis_x
axis.major_unit = 10
axis.minor_unit = 2.5
axis.major_tick_mark = AxisTickMark.INSIDE
axis.minor_tick_mark = AxisTickMark.INSIDE
axis.scaling.minimum = AxisBound(value=-10)
axis.scaling.maximum = AxisBound(value=30)
axis.tick_labels.alignment = ParagraphAlignment.RIGHT
self.assertEqual(1, axis.tick_labels.spacing)
self.assertEqual(doc, axis.display_unit.document)
# Set display unit to millions
axis.display_unit.unit = AxisBuiltInUnit.MILLIONS
axis.display_unit.custom_unit = 1000000
doc.save(file_name=ARTIFACTS_DIR + 'Charts.AxisDisplayUnit.docx')

See Also