ShapeTextOrientation

Inheritance: java.lang.Object

public class ShapeTextOrientation

Specifies orientation of text in shapes.

Examples:

Shows how to change orientation and rotation for data labels.


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 Shape shape = builder.insertChart(ChartType.COLUMN, 432.0, 252.0);
 ChartSeries series = shape.getChart().getSeries().get(0);
 ChartDataLabelCollection dataLabels = series.getDataLabels();

 // Show data labels.
 series.hasDataLabels(true);
 dataLabels.setShowValue(true);
 dataLabels.setShowCategoryName(true);

 // Define data label shape.
 dataLabels.getFormat().setShapeType(ChartShapeType.UP_ARROW);
 dataLabels.getFormat().getStroke().getFill().solid(Color.blue);

 // Set data label orientation and rotation for the entire series.
 dataLabels.setOrientation(ShapeTextOrientation.VERTICAL_FAR_EAST);
 dataLabels.setRotation(-45);

 // Change orientation and rotation of the first data label.
 dataLabels.get(0).setOrientation(ShapeTextOrientation.HORIZONTAL);
 dataLabels.get(0).setRotation(45);

 doc.save(getArtifactsDir() + "Charts.LabelOrientationRotation.docx");
 

Fields

FieldDescription
DOWNWARDText is rotated 90 degrees to the right to appear from top to bottom (tb-rl).
HORIZONTALText is arranged horizontally (lr-tb).
UPWARDText is rotated 90 degrees to the left to appear from bottom to top (bt-lr).
VERTICAL_FAR_EASTFar East characters appear vertical, other text is rotated 90 degrees to the right to appear from top to bottom (tb-rl-v).
VERTICAL_ROTATED_FAR_EASTFar East characters appear vertical, other text is rotated 90 degrees to the right to appear from top to bottom vertically, then left to right horizontally (tb-lr-v).
WORD_ART_VERTICALText is vertical, with one letter on top of the other.
WORD_ART_VERTICAL_RIGHT_TO_LEFTText is vertical, with one letter on top of the other, then right to left horizontally.
length

Methods

MethodDescription
fromName(String shapeTextOrientationName)
getName(int shapeTextOrientation)
getValues()
toString(int shapeTextOrientation)

DOWNWARD

public static int DOWNWARD

Text is rotated 90 degrees to the right to appear from top to bottom (tb-rl).

HORIZONTAL

public static int HORIZONTAL

Text is arranged horizontally (lr-tb).

UPWARD

public static int UPWARD

Text is rotated 90 degrees to the left to appear from bottom to top (bt-lr).

VERTICAL_FAR_EAST

public static int VERTICAL_FAR_EAST

Far East characters appear vertical, other text is rotated 90 degrees to the right to appear from top to bottom (tb-rl-v).

VERTICAL_ROTATED_FAR_EAST

public static int VERTICAL_ROTATED_FAR_EAST

Far East characters appear vertical, other text is rotated 90 degrees to the right to appear from top to bottom vertically, then left to right horizontally (tb-lr-v).

WORD_ART_VERTICAL

public static int WORD_ART_VERTICAL

Text is vertical, with one letter on top of the other.

WORD_ART_VERTICAL_RIGHT_TO_LEFT

public static int WORD_ART_VERTICAL_RIGHT_TO_LEFT

Text is vertical, with one letter on top of the other, then right to left horizontally.

length

public static int length

fromName(String shapeTextOrientationName)

public static int fromName(String shapeTextOrientationName)

Parameters:

ParameterTypeDescription
shapeTextOrientationNamejava.lang.String

Returns: int

getName(int shapeTextOrientation)

public static String getName(int shapeTextOrientation)

Parameters:

ParameterTypeDescription
shapeTextOrientationint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int shapeTextOrientation)

public static String toString(int shapeTextOrientation)

Parameters:

ParameterTypeDescription
shapeTextOrientationint

Returns: java.lang.String