Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class Legend

java.lang.Object
  extended by com.aspose.cells.ChartFrame
      extended by com.aspose.cells.Legend

public class Legend
extends ChartFrame

Encapsulates the object that represents the chart legend.


Method Summary
 byte getBackgroundMode()
          Gets the display mode of the background.
 Font getFont()
          Gets a Font object of the chart legend.
 int getHeight()
          Sets the height of frame, in units of 1/4000 of the chart area.
 LegendEntries getLegendEntries()
          Gets a collection of all the LegendEntry objects in the specified chart legend.
 int getPosition()
          Gets the legend position type.
 int getWidth()
          Gets the width of frame,in units of 1/4000 of the chart area.
 int getX()
          Gets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
 int getY()
          Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
 boolean isAutoScaleFont()
          Check whether the text in the object changes font size when the object size changes.
 boolean isShadow()
          Indicates if the frame has a shadow.
 void setAutoScaleFont(boolean isAutoScaleFont)
          Set whether the text in the object changes font size when the object size changes.
 void setBackgroundMode(byte mode)
          Sets the display mode of the background.
 void setFont(Font font)
          Sets a Font object of the chart legend.
 void setHeight(int height)
          Sets the height of frame,in units of 1/4000 of the chart area.
 void setPosition(int legendPositionType)
          Sets the legend position type.
 void setShadow(boolean shadow)
          Sets if the frame has a shadow.
 void setWidth(int width)
          Sets the width of frame,in units of 1/4000 of the chart area.
 void setX(int x)
          Sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.
 void setY(int y)
          Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.
 
Methods inherited from class com.aspose.cells.ChartFrame
equals, getArea, getAreaOrNull, getBorder, getBorderOrNull
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLegendEntries

public LegendEntries 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.

Returns:
the collection of all the LegendEntry objects

getPosition

public int getPosition()
Gets the legend position type.

Returns:
the legend position type.
Throws:
CellsException - if chart has bean removed.
See Also:
setPosition(int)

setPosition

public void setPosition(int legendPositionType)
Sets the legend position type.

Parameters:
legendPositionType - the legend position type. It could be one of the following values:
LegendPositionType.BOTTOM
LegendPositionType.CORNER
LegendPositionType.TOP
LegendPositionType.RIGHT
LegendPositionType.LEFT
LegendPositionType.NOT_DOCKED
Throws:
java.lang.IllegalArgumentException - if legend position type is invalid.
CellsException - if chart has bean removed.

getFont

public Font getFont()
Gets a Font object of the chart legend.

Returns:
a Font object of the chart legend.
Throws:
CellsException - if chart has bean removed.

setFont

public void setFont(Font font)
Sets a Font object of the chart legend.

Parameters:
font - a Font object of the chart legend
Throws:
CellsException - if chart has bean removed.

isAutoScaleFont

public boolean isAutoScaleFont()
Check whether the text in the object changes font size when the object size changes.

Returns:
true if the text in the object changes font size when the object size changes.

setAutoScaleFont

public void setAutoScaleFont(boolean isAutoScaleFont)
Set whether the text in the object changes font size when the object size changes.

Parameters:
isAutoScaleFont - true if the text in the object changes font size when the object size changes.

getBackgroundMode

public byte getBackgroundMode()
Gets the display mode of the background.

Returns:
the display mode of the background.
See Also:
setBackgroundMode(byte)

setBackgroundMode

public void setBackgroundMode(byte mode)
Sets the display mode of the background.

Parameters:
mode - the display mode of the background. It could be one of following:
BackgroundMode.AUTOMATIC
BackgroundMode.TRANSPARENT
BackgroundMode.OPAQUE

isShadow

public boolean isShadow()
Indicates if the frame has a shadow.

Returns:
true if the frame has a shadow.

setShadow

public void setShadow(boolean shadow)
Sets if the frame has a shadow.

Parameters:
shadow - true if the frame has a shadow.

getX

public int getX()
Gets the x coordinate of the upper left corner in units of 1/4000 of the chart area.

Returns:
the x coordinate of the upper left corner.

setX

public void setX(int x)
Sets the x coordinate of the upper left corner in units of 1/4000 of the chart area.

Parameters:
x - the x coordinate of the upper left corner.
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if x > 4000;

getY

public int getY()
Gets the y coordinate of the upper left corner in units of 1/4000 of the chart area.

Returns:
the y coordinate of the upper left corner.

setY

public void setY(int y)
Sets the y coordinate of the upper left corner in units of 1/4000 of the chart area.

Parameters:
y - the y coordinate of the upper left corner.
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if y > 4000;

getHeight

public int getHeight()
Sets the height of frame, in units of 1/4000 of the chart area.

Returns:
the height of frame.

setHeight

public void setHeight(int height)
Sets the height of frame,in units of 1/4000 of the chart area.

Parameters:
height - the height of frame.
Throws:
CellsException - if chart has bean removed.

getWidth

public int getWidth()
Gets the width of frame,in units of 1/4000 of the chart area.

Returns:
the width of frame.

setWidth

public void setWidth(int width)
Sets the width of frame,in units of 1/4000 of the chart area.

Parameters:
width - the width of frame.
Throws:
CellsException - if chart has bean removed.
java.lang.IllegalArgumentException - if width > 4000;