Example:
//Set Legend's width and height var workbook = new aspose.cells.Workbook(); var sheetIndex = workbook.getWorksheets().add(); var worksheet = workbook.getWorksheets().get(sheetIndex); var charts = worksheet.getCharts(); //Create a chart var chart = charts.get(charts.add(aspose.cells.ChartType.COLUMN, 1, 1, 10, 10)); var 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(aspose.cells.LegendPositionType.LEFT);
Property Getters/Setters Summary | ||
---|---|---|
function | getArea() | |
Gets the |
||
function | getAutoScaleFont() | |
function | setAutoScaleFont(value) | |
True if the text in the object changes font size when the object size changes. The default value is True. | ||
function | getBackground() | |
function | setBackground(value) | |
Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant. | ||
function | getBackgroundMode() | |
function | setBackgroundMode(value) | |
Gets and sets the display mode of the background The value of the property is BackgroundMode integer constant. | ||
function | getBorder() | |
Gets the |
||
function | getChart() | |
function | getDefaultHeight() | |
Represents height of default position
|
||
function | getDefaultWidth() | |
Represents width of default position
|
||
function | getDefaultX() | |
Represents x of default position
|
||
function | getDefaultY() | |
Represents y of default position
|
||
function | getFont() | |
Gets a |
||
function | getHeight() | |
function | setHeight(value) | |
Gets or sets the height of frame in units of 1/4000 of the chart area. | ||
function | isAutomaticSize() | |
function | setAutomaticSize(value) | |
Indicates whether the chart frame is automatic sized. | ||
function | isDefaultPosBeSet() | |
Indicates whether default position(DefaultX, DefaultY, DefaultWidth and DefaultHeight) are set.
|
||
function | isInnerMode() | |
function | 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. | ||
function | isOverLay() | |
function | setOverLay(value) | |
Gets or sets whether other chart elements shall be allowed to overlap this chart element. | ||
function | 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.
|
||
function | getLegendEntriesLabels() | |
Gets the labels of the legend entries after call Chart.Calculate() method.
|
||
function | getPosition() | |
function | setPosition(value) | |
Gets or sets the legend position type. The value of the property is LegendPositionType integer constant. | ||
function | getShadow() | |
function | setShadow(value) | |
True if the frame has a shadow. | ||
function | getShapeProperties() | |
Gets the |
||
function | getTextFont() | |
Gets a |
||
function | getWidth() | |
function | setWidth(value) | |
Gets or sets the width of frame in units of 1/4000 of the chart area. | ||
function | getX() | |
function | setX(value) | |
Gets or sets the x coordinate of the upper left corner in units of 1/4000 of the chart area. | ||
function | getY() | |
function | setY(value) | |
Gets or sets the y coordinate of the upper left corner in units of 1/4000 of the chart area. |
Method Summary | ||
---|---|---|
function | setPositionAuto() | |
Set position of the frame to automatic
|
function getPosition() / function setPosition(value)
function getLegendEntries()
function getLegendEntriesLabels()
function isOverLay() / function setOverLay(value)
function isInnerMode() / function setInnerMode(value)
function getChart()
function getTextFont()
function getAutoScaleFont() / function setAutoScaleFont(value)
function getBackgroundMode() / function setBackgroundMode(value)
function getBackground() / function setBackground(value)
function isAutomaticSize() / function setAutomaticSize(value)
function getX() / function setX(value)
function getY() / function setY(value)
function getHeight() / function setHeight(value)
function getWidth() / function setWidth(value)
function getShadow() / function setShadow(value)
function getShapeProperties()
function isDefaultPosBeSet()
function getDefaultX()
function getDefaultY()
function getDefaultWidth()
function getDefaultHeight()