public class ShapeTextOrientation
extends java.lang.Object
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");
| Modifier and Type | Field and Description |
|---|---|
static int |
DOWNWARD
Text is rotated 90 degrees to the right to appear from top to bottom (tb-rl).
|
static int |
HORIZONTAL
Text is arranged horizontally (lr-tb).
|
static int |
length |
static int |
UPWARD
Text is rotated 90 degrees to the left to appear from bottom to top (bt-lr).
|
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).
|
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).
|
static int |
WORD_ART_VERTICAL
Text is vertical, with one letter on top of the other.
|
static int |
WORD_ART_VERTICAL_RIGHT_TO_LEFT
Text is vertical, with one letter on top of the other, then right to left horizontally.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String shapeTextOrientationName) |
static java.lang.String |
getName(int shapeTextOrientation) |
static int[] |
getValues() |
static java.lang.String |
toString(int shapeTextOrientation) |
public static int HORIZONTAL
public static int DOWNWARD
public static int UPWARD
public static int VERTICAL_FAR_EAST
public static int VERTICAL_ROTATED_FAR_EAST
public static int WORD_ART_VERTICAL
public static int WORD_ART_VERTICAL_RIGHT_TO_LEFT
public static int length