DisplayUnitLabel
Inheritance: java.lang.Object, com.aspose.cells.ChartFrame, com.aspose.cells.ChartTextFrame
public class DisplayUnitLabel extends ChartTextFrame
Represents the display unit label.
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Excel object
int sheetIndex = workbook.getWorksheets().add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.getWorksheets().get(sheetIndex);
//Adding a sample value to "A1" cell
worksheet.getCells().get("A1").putValue(50);
//Adding a sample value to "A2" cell
worksheet.getCells().get("A2").putValue(100);
//Adding a sample value to "A3" cell
worksheet.getCells().get("A3").putValue(150);
//Adding a sample value to "A4" cell
worksheet.getCells().get("A4").putValue(200);
//Adding a sample value to "B1" cell
worksheet.getCells().get("B1").putValue(60);
//Adding a sample value to "B2" cell
worksheet.getCells().get("B2").putValue(32);
//Adding a sample value to "B3" cell
worksheet.getCells().get("B3").putValue(50);
//Adding a sample value to "B4" cell
worksheet.getCells().get("B4").putValue(40);
//Adding a sample value to "C1" cell as category data
worksheet.getCells().get("C1").putValue("Q1");
//Adding a sample value to "C2" cell as category data
worksheet.getCells().get("C2").putValue("Q2");
//Adding a sample value to "C3" cell as category data
worksheet.getCells().get("C3").putValue("Y1");
//Adding a sample value to "C4" cell as category data
worksheet.getCells().get("C4").putValue("Y2");
//Adding a chart to the worksheet
int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
Chart chart = worksheet.getCharts().get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
chart.getNSeries().add("A1:B4", true);
//Setting the data source for the category data of NSeries
chart.getNSeries().setCategoryData("C1:C4");
//Setting the display unit of value(Y) axis.
chart.getValueAxis().setDisplayUnit(DisplayUnitType.HUNDREDS);
DisplayUnitLabel displayUnitLabel = chart.getValueAxis().getDisplayUnitLabel();
//Setting the custom display unit label
displayUnitLabel.setText("100");
//Saving the Excel file
workbook.save("book1.xls");
Methods
Method | Description |
---|---|
characters(int startIndex, int length) | Returns a Characters object that represents a range of characters within the text. |
equals(Object arg0) | |
getArea() | Gets the Area. |
getAutoScaleFont() | True if the text in the object changes font size when the object size changes. |
getBackground() | Gets the display mode of the background |
getBackgroundMode() | Gets the display mode of the background |
getBorder() | Gets the Line. |
getChart() | Gets the chart to which this object belongs. |
getClass() | |
getDefaultHeight() | Represents height of default position |
getDefaultWidth() | Represents width of default position |
getDefaultX() | Represents x of default position |
getDefaultY() | Represents y of default position |
getDirectionType() | Gets the direction of text. |
getFont() | Gets a ChartArea.getFont() object of the specified ChartFrame object. |
getHeight() | Gets the height of frame in units of 1/4000 of the chart area. |
getLinkedSource() | Gets a reference to the worksheet. |
getReadingOrder() | Represents text reading order. |
getRotationAngle() | Represents text rotation angle. |
getShadow() | True if the frame has a shadow. |
getShapeProperties() | Gets the getShapeProperties() object. |
getText() | Gets the text of display unit label. |
getTextDirection() | Represents text reading order. |
getTextFont() | Gets a ChartArea.getFont() object of the specified ChartFrame object. |
getTextHorizontalAlignment() | Gets the text horizontal alignment. |
getTextOptions() | Gets the options of the text. |
getTextVerticalAlignment() | Gets the text vertical alignment of text. |
getWidth() | Gets the width of frame in units of 1/4000 of the chart area. |
getX() | Gets the x coordinate of the upper left corner in units of 1/4000 of the chart area. |
getY() | Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area. |
hashCode() | |
isAutoText() | Indicates the text is auto generated. |
isAutomaticRotation() | Indicates whether the text of the chart is automatically rotated. |
isAutomaticSize() | Indicates whether the chart frame is automatic sized. |
isDefaultPosBeSet() | Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set. |
isDeleted() | Indicates whether this data labels is deleted. |
isInnerMode() | Indicates whether the size of the plot area size includes the tick marks, and the axis labels. |
isResizeShapeToFitText() | Gets whether a shape should be auto-fit to fully contain the text described within it. |
isTextWrapped() | Gets a value indicating whether the text is wrapped. |
notify() | |
notifyAll() | |
setAutoScaleFont(boolean value) | True if the text in the object changes font size when the object size changes. |
setAutoText(boolean value) | Indicates the text is auto generated. |
setAutomaticSize(boolean value) | Indicates whether the chart frame is automatic sized. |
setBackground(int value) | Sets the display mode of the background |
setBackgroundMode(int value) | Sets the display mode of the background |
setDeleted(boolean value) | Indicates whether this data labels is deleted. |
setDirectionType(int value) | Sets the direction of text. |
setHeight(int value) | Sets the height of frame in units of 1/4000 of the chart area. |
setInnerMode(boolean value) | Indicates whether the size of the plot area size includes the tick marks, and the axis labels. |
setLinkedSource(String value) | Sets a reference to the worksheet. |
setPositionAuto() | Set position of the frame to automatic |
setReadingOrder(int value) | Represents text reading order. |
setResizeShapeToFitText(boolean value) | Sets whether a shape should be auto-fit to fully contain the text described within it. |
setRotationAngle(int value) | Represents text rotation angle. |
setShadow(boolean value) | True if the frame has a shadow. |
setText(String value) | Sets the text of display unit label. |
setTextDirection(int value) | Represents text reading order. |
setTextHorizontalAlignment(int value) | Sets the text horizontal alignment. |
setTextVerticalAlignment(int value) | Sets the text vertical alignment of text. |
setTextWrapped(boolean value) | Sets a value indicating whether the text is wrapped. |
setWidth(int value) | Sets the width of frame in units of 1/4000 of the chart area. |
setX(int value) | Sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. |
setY(int value) | Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
characters(int startIndex, int length)
public FontSetting characters(int startIndex, int length)
Returns a Characters object that represents a range of characters within the text.
Parameters:
Parameter | Type | Description |
---|---|---|
startIndex | int | The index of the start of the character. |
length | int | The number of characters. |
Returns: FontSetting - Characters object.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getArea()
public Area getArea()
Gets the Area.
Returns: Area
getAutoScaleFont()
public boolean getAutoScaleFont()
True if the text in the object changes font size when the object size changes. The default value is True.
Returns: boolean
getBackground()
public int getBackground()
Gets the display mode of the background
See BackgroundMode.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartFrame.BackgroundMode property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Returns: int
getBackgroundMode()
public int getBackgroundMode()
Gets the display mode of the background
See BackgroundMode.
Returns: int
getBorder()
public Line getBorder()
Gets the Line.
Returns: Line
getChart()
public Chart getChart()
Gets the chart to which this object belongs.
Returns: Chart
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getDefaultHeight()
public int getDefaultHeight()
Represents height of default position
Returns: int
getDefaultWidth()
public int getDefaultWidth()
Represents width of default position
Returns: int
getDefaultX()
public int getDefaultX()
Represents x of default position
Returns: int
getDefaultY()
public int getDefaultY()
Represents y of default position
Returns: int
getDirectionType()
public int getDirectionType()
Gets the direction of text.
Returns: int
getFont()
public Font getFont()
Gets a ChartArea.getFont() object of the specified ChartFrame object.
Returns: Font
getHeight()
public int getHeight()
Gets the height of frame in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? Height In Pixels = Y * Chart.ChartObject.Height / 4000;
Returns: int
getLinkedSource()
public String getLinkedSource()
Gets a reference to the worksheet.
Returns: java.lang.String
getReadingOrder()
public int getReadingOrder()
Represents text reading order.
See TextDirectionType.
Returns: int
getRotationAngle()
public int getRotationAngle()
Represents text rotation angle.
Remarks
0: Not rotated.
255: Top to Bottom.
-90: Downward.
90: Upward.
Returns: int
getShadow()
public boolean getShadow()
True if the frame has a shadow.
Returns: boolean
getShapeProperties()
public ShapePropertyCollection getShapeProperties()
Gets the getShapeProperties() object.
Returns: ShapePropertyCollection
getText()
public String getText()
Gets the text of display unit label.
Returns: java.lang.String
getTextDirection()
public int getTextDirection()
Represents text reading order.
See TextDirectionType.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartTextFrame.ReadingOrder property. This property will be removed 12 months later since March 2020. Aspose apologizes for any inconvenience you may have experienced.
Returns: int
getTextFont()
public Font getTextFont()
Gets a ChartArea.getFont() object of the specified ChartFrame object.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartFrame.Font property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Returns: Font
getTextHorizontalAlignment()
public int getTextHorizontalAlignment()
Gets the text horizontal alignment.
See TextAlignmentType.
Returns: int
getTextOptions()
public TextOptions getTextOptions()
Gets the options of the text.
Returns: TextOptions
getTextVerticalAlignment()
public int getTextVerticalAlignment()
Gets the text vertical alignment of text.
See TextAlignmentType.
Returns: int
getWidth()
public int getWidth()
Gets the width of frame in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? Width In Pixels = Width * Chart.ChartObject.Height / 4000;
Returns: int
getX()
public int getX()
Gets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? X In Pixels = X * Chart.ChartObject.Width / 4000;
Returns: int
getY()
public int getY()
Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? Y In Pixels = Y * Chart.ChartObject.Height / 4000;
Returns: int
hashCode()
public native int hashCode()
Returns: int
isAutoText()
public boolean isAutoText()
Indicates the text is auto generated.
Returns: boolean
isAutomaticRotation()
public boolean isAutomaticRotation()
Indicates whether the text of the chart is automatically rotated.
Returns: boolean
isAutomaticSize()
public boolean isAutomaticSize()
Indicates whether the chart frame is automatic sized.
Returns: boolean
isDefaultPosBeSet()
public boolean isDefaultPosBeSet()
Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
Returns: boolean
isDeleted()
public boolean isDeleted()
Indicates whether this data labels is deleted.
Returns: boolean
isInnerMode()
public boolean isInnerMode()
Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels.
Remarks
Only for Xlsx file.
Returns: boolean
isResizeShapeToFitText()
public boolean isResizeShapeToFitText()
Gets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside.
Returns: boolean
isTextWrapped()
public boolean isTextWrapped()
Gets a value indicating whether the text is wrapped.
Returns: boolean
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setAutoScaleFont(boolean value)
public void setAutoScaleFont(boolean value)
True if the text in the object changes font size when the object size changes. The default value is True.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setAutoText(boolean value)
public void setAutoText(boolean value)
Indicates the text is auto generated.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setAutomaticSize(boolean value)
public void setAutomaticSize(boolean value)
Indicates whether the chart frame is automatic sized.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setBackground(int value)
public void setBackground(int value)
Sets the display mode of the background
See BackgroundMode.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartFrame.BackgroundMode property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setBackgroundMode(int value)
public void setBackgroundMode(int value)
Sets the display mode of the background
See BackgroundMode.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setDeleted(boolean value)
public void setDeleted(boolean value)
Indicates whether this data labels is deleted.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setDirectionType(int value)
public void setDirectionType(int value)
Sets the direction of text.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setHeight(int value)
public void setHeight(int value)
Sets the height of frame in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? Height In Pixels = Y * Chart.ChartObject.Height / 4000;
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setInnerMode(boolean value)
public void setInnerMode(boolean value)
Indicates whether the size of the plot area size includes the tick marks, and the axis labels. False specifies that the size shall determine the size of the plot area, the tick marks, and the axis labels.
Remarks
Only for Xlsx file.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setLinkedSource(String value)
public void setLinkedSource(String value)
Sets a reference to the worksheet.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setPositionAuto()
public void setPositionAuto()
Set position of the frame to automatic
setReadingOrder(int value)
public void setReadingOrder(int value)
Represents text reading order.
See TextDirectionType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setResizeShapeToFitText(boolean value)
public void setResizeShapeToFitText(boolean value)
Sets whether a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setRotationAngle(int value)
public void setRotationAngle(int value)
Represents text rotation angle.
Remarks
0: Not rotated.
255: Top to Bottom.
-90: Downward.
90: Upward.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setShadow(boolean value)
public void setShadow(boolean value)
True if the frame has a shadow.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setText(String value)
public void setText(String value)
Sets the text of display unit label.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setTextDirection(int value)
public void setTextDirection(int value)
Represents text reading order.
See TextDirectionType.
Remarks
NOTE: This member is now obsolete. Instead, please use ChartTextFrame.ReadingOrder property. This property will be removed 12 months later since March 2020. Aspose apologizes for any inconvenience you may have experienced.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setTextHorizontalAlignment(int value)
public void setTextHorizontalAlignment(int value)
Sets the text horizontal alignment.
See TextAlignmentType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setTextVerticalAlignment(int value)
public void setTextVerticalAlignment(int value)
Sets the text vertical alignment of text.
See TextAlignmentType.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setTextWrapped(boolean value)
public void setTextWrapped(boolean value)
Sets a value indicating whether the text is wrapped.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setWidth(int value)
public void setWidth(int value)
Sets the width of frame in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? Width In Pixels = Width * Chart.ChartObject.Height / 4000;
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setX(int value)
public void setX(int value)
Sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? X In Pixels = X * Chart.ChartObject.Width / 4000;
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setY(int value)
public void setY(int value)
Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
Remarks
How to convert units of 1/4000 to pixels? Y In Pixels = Y * Chart.ChartObject.Height / 4000;
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |