|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.steema.teechart.TeeBase
com.steema.teechart.Shape
com.steema.teechart.TextShape
com.steema.teechart.TextShapePosition
com.steema.teechart.legend.Legend
public class Legend
Title: Legend class
Description: Accesses all Chart Legend characteristics
Copyright (c) 2005-2008 by Steema Software SL. All Rights Reserved.
Company: Steema Software SL
Field Summary | |
---|---|
protected boolean |
columnWidthAuto
|
protected int[] |
columnWidths
|
protected int |
firstValue
|
protected int |
iLastValue
|
LegendStyle |
iLegendStyle
|
Fields inherited from class com.steema.teechart.TextShapePosition |
---|
bCustomPosition |
Fields inherited from class com.steema.teechart.TextShape |
---|
defaultText, drawText |
Fields inherited from class com.steema.teechart.Shape |
---|
bBevel, bBorderRound, bBrush, bImageBevel, bTransparent, defaultVisible, pPen, shadow, shapeBounds, visible |
Fields inherited from class com.steema.teechart.TeeBase |
---|
chart |
Constructor Summary | |
---|---|
Legend(IBaseChart c)
|
Method Summary | |
---|---|
protected int |
calcItemHeight()
|
int |
clicked(int x,
int y)
Returns the index of the clicked Legend Point. |
int |
clicked(java.awt.Point p)
Returns the index of the clicked Legend Point. |
boolean |
doMouseDown(java.awt.Point p)
|
protected boolean |
drawTitle()
|
java.lang.String |
formattedLegend(int seriesOrValueIndex)
Returns the text string corresponding to a Legend position. The Legend position depends on Legend.LegendStyle. |
java.lang.String |
formattedValue(Series aSeries,
int valueIndex)
Returns the corresponding Legend text for the Series ValueIndex point. |
LegendAlignment |
getAlignment()
Defines the Legend position. Legend can be currently placed at Top, Left, Right and Bottom side of Chart. |
boolean |
getCheckBoxes()
Enables/Disables the display of Legend check boxes. Default value: false |
int |
getColorWidth()
|
int |
getColumnWidth(int column)
|
boolean |
getColumnWidthAuto()
Automatically calculates best fit of legend columns. When set to true, columnWidths control the legend width Default value: true |
boolean |
getCurrentPage()
Determines whether or not the Legend shows only the current page iItems when the Chart is divided into pages. Default value: true |
ChartPen |
getDividingLines()
Specifies the Pen attributes used to draw lines separating Legend iItems. |
int |
getFirstValue()
Defines which is the first Legend item displayed. Legend can display all active Series names or all points of a single Series. |
boolean |
getFontSeriesColor()
The legend text font color to that of the Series color. Default value: false |
int |
getHorizMargin()
Speficies the number of screen pixels between Legend and Chart rectangles. By default it is 0, meaning Legend will calculate a predefined margin based on total Legend width. |
boolean |
getInverted()
Draws the Legend iItems in opposite direction when true. Legend strings are displayed starting at top for Left and Right Aligment and starting at left for Top and Bottom Legend orientations. |
int |
getLastValue()
Returns the index of the first displayed value at legend. |
LegendItems |
getLegendItems()
|
LegendStyle |
getLegendStyle()
Defines which iItems will be displayed in the Chart Legend. |
java.lang.String[] |
getLines()
Accesses the array of Text lines. Use lines to add multiline text to TeeChart's text objects (TeeChart Header, TeeChart Axis Titles etc.). |
int |
getMaxNumRows()
The Maximum number of Legend Rows displayed for a horizontal Legend (Chart Top or Bottom). Default value: 10 |
boolean |
getResizeChart()
Automatically resizes Chart rectangle to prevent overlap with Legend. When set to true, Legend.HorizMargin and Legend.VertMargin control the amount of pixels by which the Chart rectangle will be reduced. |
Series |
getSeries()
Determines which series is used as data for the Legend entries. By default, the Legend chooses the first Active Series with ShowInLegend:=true. |
LegendSymbol |
getSymbol()
Controls the width and position of the color rectangle associated with each Legend's item. |
java.lang.String |
getText()
Adds text to the Legend. |
LegendTextStyle |
getTextStyle()
Determines how Legend text iItems will be formatted. Plain shows the point Label only. LeftValue shows the point Value and the point Label. |
LegendTitle |
getTitle()
Sets the Title text and its characteristics at the top of the legend |
int |
getTopLeftPos()
Specifies the Legend's top position in percent of total chart height. It's used when Legend.Alignment is Left or Right only. |
boolean |
getVertical()
Is read only and returns true only if the legend is left or right aligned. |
int |
getVertMargin()
The vertical margin in pixels between Legend and Chart rectangle. Legend.ResizeChart must be true and Legend.Alignment must be Top or Bottom. |
int |
getVertSpacing()
The vertical spacing between Legend iItems (pixels). Default value: 0 |
boolean |
hasCheckBoxes()
Returns true when the legend displays checkboxes and it is showing series names. |
void |
paint(IGraphics3D g,
Rectangle rect)
Paints the TextShape object on the Chart Canvas. |
protected java.lang.Object |
readResolve()
|
Rectangle |
resizeChartRect(Rectangle rect)
Returns the chart rectangle minus the space occupied by the Legend. |
void |
setAlignment(LegendAlignment value)
Defines the Legend position. Default value: Right |
void |
setChart(IBaseChart c)
Chart associated with this object. |
void |
setCheckBoxes(boolean value)
Displays the Legend check boxes when true. Default value: false |
void |
setColorWidth(int value)
|
void |
setColumnWidth(int column,
int value)
|
void |
setColumnWidthAuto(boolean value)
Automatically calculates best fit of legend columns. When set to true, columnWidths control the legend width Default value: true |
void |
setCurrentPage(boolean value)
When true, the Legend shows only the current page iItems when the Chart is divided into pages. Default value: true |
void |
setDividingLines(ChartPen value)
Internal use - serialization |
void |
setFirstValue(int value)
Determines which is the first Legend item displayed. Default value: 0 |
void |
setFontSeriesColor(boolean value)
Sets the legend text font color to that of the Series color. Default value: false |
void |
setHorizMargin(int value)
Speficies the number of screen pixels between Legend and Chart rectangles. Default value: 0 |
void |
setInverted(boolean value)
Draws the Legend iItems in opposite direction when true. Default value: false |
void |
setLegendStyle(LegendStyle value)
Defines which iItems will be displayed in the Chart Legend. |
void |
setLines(java.lang.String[] value)
Accesses the array of Text lines. Default value: null |
void |
setMaxNumRows(int value)
Sets the Maximum number of Legend Rows displayed for a horizontal Legend (Chart Top or Bottom). Default value: 10 |
void |
setResizeChart(boolean value)
Automatically resizes Chart rectangle to prevent overlap with Legend. When set to true, Legend.HorizMargin and Legend.VertMargin control the amount of pixels by which the Chart rectangle will be reduced. |
void |
setSeries(Series value)
Determines which series is used as data for the Legend entries. |
void |
setSymbol(LegendSymbol value)
|
void |
setText(java.lang.String value)
Adds text to the Legend. |
void |
setTextStyle(LegendTextStyle value)
Specifies how Legend text iItems will be formatted. Default value: LeftValue |
void |
setTopLeftPos(int value)
Specifies the Legend's top position in percent of total chart height. Default value: 10 |
void |
setVertMargin(int value)
Determines the vertical margin in pixels between Legend and Chart rectangle. Default value: 0 |
void |
setVertSpacing(int value)
Determines the vertical spacing between Legend iItems (pixels). Default value: 0 |
Methods inherited from class com.steema.teechart.TextShapePosition |
---|
getCustomPosition, setCustomPosition, shouldSerializeBottom, shouldSerializeLeft, shouldSerializeRight, shouldSerializeTop |
Methods inherited from class com.steema.teechart.TextShape |
---|
assign, drawRectRotated, getAutoSize, getFont, getLinesLength, getShadowSize, getShapeStyle, getTextFormat, paint, setAutoSize, setDrawText, setShadowSize, setShapeStyle, setTextFormat |
Methods inherited from class com.steema.teechart.Shape |
---|
assign, getBevel, getBevelInner, getBevelOuter, getBevelWidth, getBorderRound, getBottom, getBrush, getColor, getGradient, getHeight, getImage, getImageBevel, getImageMode, getImageTransparent, getLeft, getPen, getRight, getShadow, getShapeBounds, getTop, getTransparency, getTransparent, getVisible, getWidth, setBevel, setBevelInner, setBevelOuter, setBevelWidth, setBorderRound, setBottom, setBrush, setColor, setColor, setDefaultVisible, setHeight, setImage, setImageMode, setImageTransparent, setLeft, setPen, setRight, setShapeBounds, setTop, setTransparency, setTransparent, setVisible, setWidth |
Methods inherited from class com.steema.teechart.TeeBase |
---|
getChart, invalidate, setBooleanProperty, setColorProperty, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public transient LegendStyle iLegendStyle
protected boolean columnWidthAuto
protected int[] columnWidths
protected transient int firstValue
protected transient int iLastValue
Constructor Detail |
---|
public Legend(IBaseChart c)
Method Detail |
---|
protected java.lang.Object readResolve()
readResolve
in class TextShape
public LegendTextStyle getTextStyle()
public int getLastValue()
public void setTextStyle(LegendTextStyle value)
value
- LegendTextStylepublic Series getSeries()
public void setSeries(Series value)
value
- Seriespublic boolean getCheckBoxes()
public void setChart(IBaseChart c)
Shape
setChart
in class TextShape
c
- IBaseChartpublic void setCheckBoxes(boolean value)
value
- booleanpublic boolean getCurrentPage()
public void setCurrentPage(boolean value)
value
- booleanpublic boolean getFontSeriesColor()
public void setFontSeriesColor(boolean value)
value
- booleanpublic ChartPen getDividingLines()
public void setDividingLines(ChartPen value)
public LegendSymbol getSymbol()
public void setSymbol(LegendSymbol value)
public boolean getInverted()
public void setInverted(boolean value)
value
- booleanpublic LegendAlignment getAlignment()
public void setAlignment(LegendAlignment value)
value
- LegendAlignmentsLegLegendAlignment
public int getColumnWidth(int column)
public void setColumnWidth(int column, int value)
public boolean getColumnWidthAuto()
public void setColumnWidthAuto(boolean value)
value
- booleanpublic int getFirstValue()
public void setFirstValue(int value)
value
- intgetFirstValue()
public int getTopLeftPos()
public void setTopLeftPos(int value)
value
- intpublic int getMaxNumRows()
public void setMaxNumRows(int value)
value
- intpublic java.lang.String[] getLines()
TextShape
getLines
in class TextShape
public void setLines(java.lang.String[] value)
TextShape
setLines
in class TextShape
value
- String[]public java.lang.String getText()
getText
in class TextShape
public void setText(java.lang.String value)
setText
in class TextShape
value
- Stringpublic int getVertSpacing()
public void setVertSpacing(int value)
value
- intpublic int getHorizMargin()
public void setHorizMargin(int value)
value
- intpublic int getVertMargin()
public void setVertMargin(int value)
value
- intpublic boolean getResizeChart()
public void setResizeChart(boolean value)
value
- booleanpublic LegendStyle getLegendStyle()
public void setLegendStyle(LegendStyle value)
value
- LegendStylesgetLegendStyle()
public LegendTitle getTitle()
public boolean doMouseDown(java.awt.Point p)
public int clicked(java.awt.Point p)
p
- Point
public int clicked(int x, int y)
x
- inty
- int
protected int calcItemHeight()
protected boolean drawTitle()
public boolean hasCheckBoxes()
public boolean getVertical()
public int getColorWidth()
public void setColorWidth(int value)
public Rectangle resizeChartRect(Rectangle rect)
rect
- Rectangle
public void paint(IGraphics3D g, Rectangle rect)
TextShape
paint
in class TextShape
g
- IGraphics3Drect
- Rectanglepublic java.lang.String formattedLegend(int seriesOrValueIndex)
seriesOrValueIndex
- int
public java.lang.String formattedValue(Series aSeries, int valueIndex)
aSeries
- SeriesvalueIndex
- int
public LegendItems getLegendItems()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |