Category X axis

Concept The X axis is usually the horizontal axis and contains category axis labels.



EasyXLS™ library allows setting the category axis labels, axis options and formatting the axis.



The axis formatting is formed by number format, font settings, fill settings, line style settings, line color settings, shadow settings, 3D-format and alignment settings. Concept in action The below example shows how to format the category axis for an Excel file.

The screen shot provides an example of a cylinder chart. The X axis is formatted: line-color (steel blue), line-style (dash-dot-dot), line-width and foreground (red).





Category X axis labels The category axis labels can be set using ExcelChart.easy_setCategoryXAxisLabels method. Also, as showed in the above tutorial, the axis labels are automatically built from the data source when the chart sheet is added to the workbook. See also:

Category X axis title The axis can have an assigned title that explains the meaning of the axis using ExcelAxis.setAxisTitle method. The title includes the name of the axis and formatting options. See also:

Category X axis options EasyXLS library allows you to set different axis options like:



- Interval between tick marks

- Interval between labels

- Categories in reverse order

- Major tick mark type

- Minor tick mark type

- Axis labels settings

- Vertical axis crosses settings

- Position axis settings



The goal can be achieved using various methods from ExcelAxis class.

Axis number format EasyXLS allows you to set the number format of the axis labels by means of ExcelAxis.setNumberFormat method. The number format can also be linked to the number format of the data source.

Axis font settings EasyXLS allows you to set the font appearance of the axis through the usage of FontDrawingObject.getFontFormat method that is available in ExcelAxis class because of the class inheritance.

The supported font settings are:

- Font name

- Font style (bold, italic, regular)

- Font size

- Font color

- Font underline style

- Font effect (strikethrough, superscript, subscript, offset, small caps)

Axis fill formatting EasyXLS allows you to set the background appearance of the chart axis through the usage of FillDrawingObject.getFillFormat method that is available in ExcelAxis class because of the class inheritance.



The supported fill options are:

- No fill

- Solid fill (axis color, axis transparency)

- Gradient fill

- Picture and texture fill

- Automatic

Axis line color formatting EasyXLS allows you to set the line color appearance of the chart axis through the usage of LineDrawingObject.getLineColorFormat method that is available in ExcelAxis class because of the class inheritance.



The supported line color options are:

- No line

- Solid line (axis line color)

- Gradient line

- Automatic

Axis line style formatting EasyXLS allows you to set the line style of the chart axis through the usage of LineDrawingObject.getLineStyleFormat method that is available in ExcelAxis class because of the class inheritance.



The supported border style options are:

- Line width

- Compound type

- Dash type

- Cap type

- Join type

- Arrow settings

Axis shadow formatting EasyXLS allows you to set the shadow appearance of the chart axis through the usage of LineDrawingObject.getShadowFormat method that is available in ExcelAxis class because of the class inheritance.



The supported shadow options are:

- Preset shadows

- Shadow color

- Transparency, size, blur, angle and distance

Axis 3D formatting EasyXLS allows you to set the 3D appearance of the chart axis through the usage of EffectDrawingObject.get3DFormat method that is available in ExcelAxis class because of the class inheritance.



The supported 3D options are:



- Surface settings (material and lighting)

Axis alignment formatting EasyXLS allows you to set the alignment of the chart axis through the usage of AlignDrawingObject.getAlignmentFormat method that is available in ExcelAxis class because of the class inheritance.



The supported alignment options are:

- Horizontal alignment

- Text direction

- Rotation of the text

Related methods: Related constants: