Example:
# Set Legend's width and height workbook = Workbook() sheetIndex = workbook.getWorksheets().add() worksheet = workbook.getWorksheets().get(sheetIndex) charts = worksheet.getCharts() # Create a chart chart = charts.get(charts.add(ChartType.COLUMN, 1, 1, 10, 10)) legend = chart.getLegend() # Legend is at right side of chart by default. # If the legend is at left or right side of the chart, setting Legend.X property will not take effect. # If the legend is at top or bottom side of the chart, setting Legend.Y property will not take effect. legend.setY(1500) legend.setWidth(50) legend.setHeight(50) # Set legend's position legend.setPosition(LegendPositionType.LEFT)
Property Getters/Setters Summary | ||
---|---|---|
method | getArea() | |
Gets the |
||
method | getAutoScaleFont() | |
method | setAutoScaleFont(value) | |
True if the text in the object changes font size when the object size changes. The default value is True. | ||
method | getBackground() | |
method | setBackground(value) | |
Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant. | ||
method | getBackgroundMode() | |
method | setBackgroundMode(value) | |
Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant. | ||
method | getBorder() | |
Gets the |
||
method | getChart() | |
method | getDefaultHeight() | |
Represents height of default position | ||
method | getDefaultWidth() | |
Represents width of default position | ||
method | getDefaultX() | |
Represents x of default position | ||
method | getDefaultY() | |
Represents y of default position | ||
method | getFont() | |
Gets a |
||
method | getHeight() | |
method | setHeight(value) | |
Gets or sets the height of frame in units of 1/4000 of the chart area. | ||
method | isAutomaticSize() | |
method | setAutomaticSize(value) | |
Indicates whether the chart frame is automatic sized. | ||
method | isDefaultPosBeSet() | |
Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set. | ||
method | isInnerMode() | |
method | setInnerMode(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. | ||
method | isOverLay() | |
method | setOverLay(value) | |
Gets or sets whether other chart elements shall be allowed to overlap this chart element. | ||
method | getLegendEntries() | |
Gets a collection of all the LegendEntry objects in the specified chart legend. Setting the legend entries of the surface chart is not supported. So it will return null if the chart type is surface chart type. | ||
method | getLegendEntriesLabels() | |
Gets the labels of the legend entries after call Chart.Calculate() methond. | ||
method | getPosition() | |
method | setPosition(value) | |
Gets or sets the legend position type. The value of the property is LegendPositionType integer constant. | ||
method | getShadow() | |
method | setShadow(value) | |
True if the frame has a shadow. | ||
method | getShapeProperties() | |
Gets the |
||
method | getTextFont() | |
Gets a |
||
method | getWidth() | |
method | setWidth(value) | |
Gets or sets the width of frame in units of 1/4000 of the chart area. | ||
method | getX() | |
method | setX(value) | |
Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. | ||
method | getY() | |
method | setY(value) | |
Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. |
Method Summary | ||
---|---|---|
method | setPositionAuto() | → inherited from ChartFrame |
Set position of the frame to automatic |
Property Getters/Setters Detail |
---|
getPosition/setPosition : int | |
int getPosition() / setPosition(value) |
getLegendEntries : LegendEntryCollection | |
LegendEntryCollection getLegendEntries() |
getLegendEntriesLabels : ArrayList | |
ArrayList getLegendEntriesLabels() |
isOverLay/setOverLay : boolean | |
boolean isOverLay() / setOverLay(value) |
isInnerMode/setInnerMode : boolean | |
boolean isInnerMode() / setInnerMode(value) |
getChart : Chart | |
Chart getChart() |
getBorder : Line | |
Line getBorder() |
getArea : Area | |
Area getArea() |
getTextFont : Font | |
Font getTextFont() |
getFont : Font | |
Font getFont() |
getAutoScaleFont/setAutoScaleFont : boolean | |
boolean getAutoScaleFont() / setAutoScaleFont(value) |
getBackgroundMode/setBackgroundMode : int | |
int getBackgroundMode() / setBackgroundMode(value) |
getBackground/setBackground : int | |
int getBackground() / setBackground(value) |
isAutomaticSize/setAutomaticSize : boolean | |
boolean isAutomaticSize() / setAutomaticSize(value) |
getX/setX : int | |
int getX() / setX(value) |
getY/setY : int | |
int getY() / setY(value) |
getHeight/setHeight : int | |
int getHeight() / setHeight(value) |
getWidth/setWidth : int | |
int getWidth() / setWidth(value) |
getShadow/setShadow : boolean | |
boolean getShadow() / setShadow(value) |
getShapeProperties : ShapePropertyCollection | |
ShapePropertyCollection getShapeProperties() |
isDefaultPosBeSet : boolean | |
boolean isDefaultPosBeSet() |
getDefaultX : int | |
int getDefaultX() |
getDefaultY : int | |
int getDefaultY() |
getDefaultWidth : int | |
int getDefaultWidth() |
getDefaultHeight : int | |
int getDefaultHeight() |
Method Detail |
---|
setPositionAuto | |
setPositionAuto() |