TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Class: Legend

Source Location: /legend/Legend.php

Class Overview

TeeBase
   |
   --TeeShape
      |
      --TextShape
         |
         --TextShapePosition
            |
            --Legend

Legend class


Author(s):

Version:

  • 1.0

Copyright:

  • (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>

Variables

Methods


Inherited Variables

Inherited Methods

Class: TextShapePosition

TextShapePosition::TextShapePosition()
TextShapePosition::getCustomPosition()
Allows custom positioning of TextShape when true.
Default value: false
TextShapePosition::setCustomPosition()
Set to true to permit custom positioning of TextShape.
Default value: false
TextShapePosition::shouldSerializeBottom()
TextShapePosition::shouldSerializeLeft()
TextShapePosition::shouldSerializeRight()
TextShapePosition::shouldSerializeTop()
TextShapePosition::__get()
TextShapePosition::__set()

Class: TextShape

TextShape::TextShape()
The class constructor.
TextShape::assign()
Assign all properties from a TextShape to another.
TextShape::drawRectRotated()
Draws the Shape rectangle rotated by Angle degrees.
TextShape::getFont()
Determines the font attributes used to output ShapeSeries.<!-- -->Text Strings.
TextShape::getLines()
Accesses the array of Text lines.
TextShape::getLinesLength()
TextShape::getShadowSize()
Obsolete.&nbsp;Please use Shadow.<!-- -->Size.
TextShape::getShapeStyle()
Shape may be rectagular or rounded rectangular in shape.
Default value: TextShapeStyle.Rectangle
TextShape::getText()
Displays customized strings inside Shapes.
You can use Font and Aligment to control Text display.

Note: You would maybe need to change Shape Font size to a different value when creating metafiles or when zooming Charts.
TextShape::getTextFormat()
Determines if Text is drawn as Normal or HTML styles.
TextShape::paint()
Paints the TextShape object on the Chart Canvas.
TextShape::readResolve()
TextShape::setChart()
TextShape::setDrawText()
TextShape::setLines()
Accesses the array of Text lines.
TextShape::setShadowSize()
Obsolete.&nbsp;Please use Shadow.<!-- -->Size.
TextShape::setShapeStyle()
Shape may be rectagular or rounded rectangular in shape.
Default value: TextShapeStyle.Rectangle
TextShape::setText()
Displays customized strings inside Shapes.
TextShape::setTextFormat()
TextShape::_paint()
Paints the TextShape object on the Chart Canvas.
TextShape::__get()
TextShape::__set()

Class: TeeShape

TeeShape::__construct()
The class constructor.
TeeShape::assign()
Assign all properties from a shape to another.
TeeShape::getBevel()
Sets the bevel characteristics of the Shape.
TeeShape::getBevelInner()
Obsolete.&ndsp;Please use Bevel.<!-- -->Inner.
TeeShape::getBevelOuter()
Obsolete.&nbsp;Please use Bevel.<!-- -->Outer
TeeShape::getBevelWidth()
Obsolete.&nbsp;Please use Bevel.<!-- -->Width
TeeShape::getBorderRound()
Rounds the Borders of the Chart Shapes.
TeeShape::getBottom()
Shape rectangle bottom co-ordinate.
TeeShape::getBrush()
Defines the kind of brush used to fill shape background.
TeeShape::getColor()
Defines the shape Color.
TeeShape::getGradient()
Calls the Gradient characteristics for the shape.
TeeShape::getHeight()
TeeShape::getImage()
Rendered Image for Shape background.
Default value: null
TeeShape::getImageBevel()
Sets the bevel characteristics of the Shape.
TeeShape::getImageMode()
ImageMode for rendered Shape background Image.
Default value: ImageMode::$Stretch
TeeShape::getImageTransparent()
Sets the shape image to transparent.
TeeShape::getLeft()
Shape rectangle left co-ordinate.
TeeShape::getPen()
Specifies the pen used to draw the shape.
TeeShape::getRight()
Shape rectangle right co-ordinate.
TeeShape::getShadow()
Defines the shape's Shadow characteristics.
TeeShape::getShapeBorders()
Defines the Shape Borders.
TeeShape::getShapeBounds()
Defines the boundaries of the Shape.
TeeShape::getTop()
Shape rectangle top co-ordinate.
TeeShape::getTransparency()
The Transparency level from 0 to 100% of shape.
TeeShape::getTransparent()
Enables/disables transparency of shape.
See transparency, which sets percentage transparency when Transparent is true.
TeeShape::getVisible()
Shows or hides the Shape.
TeeShape::getWidth()
TeeShape::paint()
TeeShape::setBevel()
Internal use - serialization
TeeShape::setBevelInner()
Defines the inner bevel type of the TChart Panel border.
TeeShape::setBevelOuter()
Defines the outer bevel type of the TChart Panel border.
TeeShape::setBevelWidth()
Obsolete.&nbsp;Please use Bevel.<!-- -->Width
TeeShape::setBorderRound()
Rounds the Borders of the Chart Shapes.
TeeShape::setBottom()
Shape rectangle bottom co-ordinate.
TeeShape::setBrush()
Internal use - serialization
TeeShape::setChart()
Chart associated with this object.
TeeShape::setColor()
TeeShape::setDefaultVisible()
TeeShape::setHeight()
TeeShape::setImage()
Sets Rendered Image for Shape background.
Default value: null
TeeShape::setImageMode()
Sets the ImageMode for rendered Shape background Image.
Default value: ImageMode.Stretch
TeeShape::setImageTransparent()
TeeShape::setLeft()
Shape rectangle left co-ordinate.
TeeShape::setPen()
Internal use - serialization
TeeShape::setRight()
Shape rectangle right co-ordinate.
TeeShape::setShapeBounds()
Defines the boundaries of the Shape.
TeeShape::setTop()
Shape rectangle top co-ordinate.
TeeShape::setTransparency()
Sets Transparency level from 0 to 100% of shape.
Default value: 0
TeeShape::setTransparent()
Enables/disables transparency of shape.
TeeShape::setVisible()
Shows or hides the Shape.
TeeShape::setWidth()
TeeShape::_setColor()
Defines the shape Color.
TeeShape::__get()
TeeShape::__set()

Class: TeeBase

TeeBase::__construct()
TeeBase::getChart()
Chart associated with this object.
TeeBase::invalidate()
Use invalidate when the entire canvas needs to be repainted.
TeeBase::setBooleanProperty()
TeeBase::setChart()
Chart associated with this object.
TeeBase::setColorProperty()
TeeBase::setDoubleProperty()
TeeBase::setIntegerProperty()
TeeBase::setStringProperty()
TeeBase::_setColorProperty()
TeeBase::__get()
TeeBase::__set()

Class Details

[line 16]
Legend class

Description: Accesses all Chart Legend characteristics




Tags:

author:  
version:  1.0
copyright:  (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
link:  http://www.steema.com


[ Top ]


Class Variables

static $CHECKBOXSIZE =  11

[line 18]


Type:   mixed


[ Top ]

static $LEGENDOFF2 =  2

[line 19]


Type:   mixed


[ Top ]

static $LEGENDOFF4 =  4

[line 20]


Type:   mixed


[ Top ]

static $MAXLEGENDCOLUMNS =  2

[line 21]


Type:   mixed


[ Top ]

$columnWidthAuto = true

[line 60]



Tags:

access:  protected

Type:   mixed


[ Top ]

$columnWidths =

[line 61]



Tags:

access:  protected

Type:   mixed


[ Top ]

$firstValue = 0

[line 62]



Tags:

access:  protected

Type:   mixed


[ Top ]

$iLastValue = 0

[line 63]



Tags:

access:  protected

Type:   mixed


[ Top ]

$iLegendStyle =

[line 65]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


constructor Legend [line 85]

Legend Legend( $c)



Tags:

access:  public


Parameters:

   $c  

[ Top ]

method calcItemHeight [line 766]

void calcItemHeight( )



Tags:

access:  public


[ Top ]

method clicked [line 723]

int clicked( x $x, y $y)

Returns the index of the clicked Legend Point.



Tags:

access:  public


Parameters:

x   $x   int
y   $y   int

[ Top ]

method doMouseDown [line 675]

void doMouseDown( $p)



Tags:

access:  public


Parameters:

   $p  

[ Top ]

method drawTitle [line 783]

void drawTitle( )



Tags:

access:  protected


[ Top ]

method formattedLegend [line 1484]

String formattedLegend( seriesOrValueIndex $seriesOrValueIndex)

Returns the text string corresponding to a Legend position.


The Legend position depends on Legend.LegendStyle. If LegendStyle is lsSeries, then the text string will be the SeriesOrValueIndexth Active Series Title.
If LegendStyle is lsValues, then the text string will be the formatted SeriesOrValueIndexth value of the first Active Series in the Chart.
If LegendStyle is lsAuto and only one Active Series exists in the Chart, then the LegendStyle is considered to be lsValues.
If there is more than one Active Series then LegendStyle will be lsSeries.
Values are formatted accordingly to LegendTextStyle.




Tags:

access:  public


Parameters:

seriesOrValueIndex   $seriesOrValueIndex   int

[ Top ]

method formattedValue [line 1529]

String formattedValue( aSeries $aSeries, valueIndex $valueIndex)

Returns the corresponding Legend text for the Series ValueIndex point.


Legend.LegendTextStyle is used to properly format the point values and labels.




Tags:

access:  public


Parameters:

aSeries   $aSeries   Series
valueIndex   $valueIndex   int

[ Top ]

method getAlignment [line 368]

LegendAlignment getAlignment( )

Defines the Legend position.


Legend can be currently placed at Top, Left, Right and Bottom side of Chart.
Left and Right Legend alignments define a vertical Legend with currently one single column of items.
Top and Bottom Legend alignments define an horizontal Legend with currently one single row of items.
The Legend itself automatically reduces the number of displayed legend items based on the available charting space.
The Legend.ResizeChart property controls if Legend dimensions should be used to reduce Chart points space.
The Legend.GetLegendRect event provides a mechanism to supply the desired Rectangle Legend dimensions and placement.
The Legend.GetLegendPos event can be used to specify fixed Legend items X Y coordinates.
The Legend.HorizMargin and VertMargin properties control distance between Legend and Left and Right margins.
The Legend.TopLeftPos property can be used in Left Legend alignments to control vertical distance between Legend and Top Chart Margin.

These techniques allow almost complete Legend control.
Default value: Right




Tags:

access:  public


[ Top ]

method getCheckBoxes [line 206]

boolean getCheckBoxes( )

Enables/Disables the display of Legend check boxes.
Default value: false



Tags:

access:  public


[ Top ]

method getColorWidth [line 917]

void getColorWidth( )



Tags:

access:  public


[ Top ]

method getColumnWidth [line 387]

void getColumnWidth( $column)



Tags:

access:  public


Parameters:

   $column  

[ Top ]

method getColumnWidthAuto [line 409]

boolean getColumnWidthAuto( )

Automatically calculates best fit of legend columns.
When set to true, columnWidths control the legend width
Default value: true



Tags:

access:  public


[ Top ]

method getCurrentPage [line 236]

boolean getCurrentPage( )

Determines whether or not the Legend shows only the current page items when the Chart is divided into pages.
Default value: true



Tags:

access:  public


[ Top ]

method getDividingLines [line 281]

ChartPen getDividingLines( )

Specifies the Pen attributes used to draw lines separating Legend items.


Lines are drawn horizontally for Left or Right aligned Legend and vertically for Top or Bottom Legend alignments.




Tags:

access:  public


[ Top ]

method getFirstValue [line 437]

int getFirstValue( )

Defines which is the first Legend item displayed.


Legend can display all active Series names or all points of a single Series. FirstValue should be set accordingly, taking care not to overflow the number of active Series or the number of Series points. You can use FirstValue to show a specific subset of Series or points in Legend. It should be greater or equal to zero, and lower than the number of active Series or Series points. See Legend.LegendStyle for a description of the different Legend styles.
Default value: 0




Tags:

access:  public


[ Top ]

method getFontSeriesColor [line 259]

boolean getFontSeriesColor( )

The legend text font color to that of the Series color.
Default value: false



Tags:

access:  public


[ Top ]

method getHorizMargin [line 553]

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. It is only used when Legend position is Left or Right aligned otherwise use VertMargin.
Default value: 0




Tags:

access:  public


[ Top ]

method getInverted [line 327]

boolean getInverted( )

Draws the Legend items 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. You can use Legend.FirstValue to determine the ValueIndex for the first Legend text item.
Default value: false




Tags:

access:  public


[ Top ]

method getLastValue [line 142]

int getLastValue( )

Returns the index of the first displayed value at legend.

The index can be a series value index or a series index depending on legend style.




Tags:

access:  public


[ Top ]

method getLegendStyle [line 645]

LegendStyle getLegendStyle( )

Defines which items will be displayed in the Chart Legend.
Series style shows the Series.Title of all active Series in a Chart.

Whenever a Series Title is empty, Series Name is used.
Values style shows a text representation of all points of the first active Series in a Chart.
LastValues style shows the last point value and the Series.Title of all active Series in a Chart. It is useful for real-time charting, where new points are being added at the end of each Series.
Auto style (the default) means LegendStyle will be Series when there's more than one Active Series, and Values when there's only one Series in a Chart.
Legend.TextStyle determines how the Series point values are formatted.
Default value: auto




Tags:

access:  public


[ Top ]

method getLines [line 497]

void getLines( )



Tags:

access:  public


Overrides TextShape::getLines() (Accesses the array of Text lines.
)

[ Top ]

method getMaxNumRows [line 482]

int getMaxNumRows( )

The Maximum number of Legend Rows displayed for a horizontal Legend (Chart Top or Bottom).
Default value: 10



Tags:

access:  public


[ Top ]

method getResizeChart [line 602]

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.
Default value: true




Tags:

access:  public


[ Top ]

method getSeries [line 186]

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. It only applies to Legend style "Values".



Tags:

access:  public


[ Top ]

method getSymbol [line 303]

LegendSymbol getSymbol( )

Controls the width and position of the color rectangle associated with each Legend's item.



Tags:

access:  public


[ Top ]

method getText [line 510]

String getText( )

Adds text to the Legend.



Tags:

access:  public


Overrides TextShape::getText() (Displays customized strings inside Shapes.
You can use Font and Aligment to control Text display.

Note: You would maybe need to change Shape Font size to a different value when creating metafiles or when zooming Charts.)

[ Top ]

method getTextAlign [line 146]

void getTextAlign( )



Tags:

access:  public


[ Top ]

method getTextStyle [line 131]

LegendTextStyle getTextStyle( )

Determines how Legend text items will be formatted.


Plain shows the point Label only.
LeftValue shows the point Value and the point Label.
RightValue shows the point Label and the point Value.
LeftPercent shows the percent the point represents and the point Label.
RightPercent shows the point Label and the percent the points represent.
XValue shows the point's X value. It applies only to Series with X (horizontal) values.

Values are pre-formatted using the Series ValueFormat property.
Percents are pre-formatted using the Series PercentFormat property.

Default value: LeftValue




Tags:

access:  public


[ Top ]

method getTitle [line 668]

void getTitle( )

Sets the Title text and its characteristics at the top of the legend



Tags:

access:  public


[ Top ]

method getTopLeftPos [line 461]

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. For Top or Bottom Legend alignments, you can use the Chart's MarginTop and MarginBottom.
Default value: 10




Tags:

access:  public


[ Top ]

method getVertical [line 845]

boolean getVertical( )

Is read only and returns true only if the legend is left or right aligned.



Tags:

access:  public


[ Top ]

method getVertMargin [line 579]

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. When 0, the corresponding Chart margin method is used to determine the amount of pixels for margins (Chart.MarginTop for Top Legend.alignment and Chart.MarginBottom for Bottom Legend.Alignment).
Default value: 0




Tags:

access:  public


[ Top ]

method getVertSpacing [line 529]

int getVertSpacing( )

The vertical spacing between Legend items (pixels).
Default value: 0



Tags:

access:  public


[ Top ]

method hasCheckBoxes [line 835]

boolean hasCheckBoxes( )

Returns true when the legend displays checkboxes and it is showing series names.



Tags:

access:  public


[ Top ]

method paint [line 1345]

void paint( $g, $rect)



Tags:

access:  public


Overrides TextShape::paint() (Paints the TextShape object on the Chart Canvas.)

Parameters:

   $g  
   $rect  

[ Top ]

method readResolve [line 105]

void readResolve( )



Tags:

access:  protected


Overrides TextShape::readResolve() (parent method not documented)

[ Top ]

method resizeChartRect [line 1283]

Rectangle resizeChartRect( rect $rect)

Returns the chart rectangle minus the space occupied by the Legend.



Tags:

access:  public


Parameters:

rect   $rect   Rectangle

[ Top ]

method setAlignment [line 380]

void setAlignment( value $value)

Defines the Legend position.
Default value: Right



Tags:

see:  LegLegendAlignment
access:  public


Parameters:

value   $value   LegendAlignments

[ Top ]

method setChart [line 210]

void setChart( $c)



Tags:

access:  public


Overrides TextShape::setChart() (parent method not documented)

Parameters:

   $c  

[ Top ]

method setCheckBoxes [line 224]

void setCheckBoxes( value $value)

Displays the Legend check boxes when true.
Default value: false



Tags:

access:  public


Parameters:

value   $value   boolean

[ Top ]

method setColorWidth [line 921]

void setColorWidth( $value)



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method setColumnWidth [line 395]

void setColumnWidth( $column, $value)



Tags:

access:  public


Parameters:

   $column  
   $value  

[ Top ]

method setColumnWidthAuto [line 420]

void setColumnWidthAuto( value $value)

Automatically calculates best fit of legend columns.
When set to true, columnWidths control the legend width
Default value: true



Tags:

access:  public


Parameters:

value   $value   boolean

[ Top ]

method setCurrentPage [line 249]

void setCurrentPage( value $value)

When true, the Legend shows only the current page items when the Chart is divided into pages.


Default value: true




Tags:

access:  public


Parameters:

value   $value   boolean

[ Top ]

method setDividingLines [line 292]

void setDividingLines( $value)

Internal use - serialization



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method setFirstValue [line 448]

void setFirstValue( value $value)

Determines which is the first Legend item displayed.
Default value: 0



Tags:

see:  getFirstValue
access:  public


Parameters:

value   $value   int

[ Top ]

method setFontSeriesColor [line 269]

void setFontSeriesColor( value $value)

Sets the legend text font color to that of the Series color.
Default value: false



Tags:

access:  public


Parameters:

value   $value   boolean

[ Top ]

method setHorizMargin [line 564]

void setHorizMargin( value $value)

Speficies the number of screen pixels between Legend and Chart rectangles.
Default value: 0



Tags:

access:  public


Parameters:

value   $value   int

[ Top ]

method setInverted [line 338]

void setInverted( value $value)

Draws the Legend items in opposite direction when true.
Default value: false



Tags:

access:  public


Parameters:

value   $value   boolean

[ Top ]

method setLegendStyle [line 657]

void setLegendStyle( value $value)

Defines which items will be displayed in the Chart Legend.
Default value: Auto



Tags:

see:  getLegendStyle
access:  public


Parameters:

value   $value   LegendStyles

[ Top ]

method setLines [line 501]

void setLines( $value)



Tags:

access:  public


Overrides TextShape::setLines() (Accesses the array of Text lines.
)

Parameters:

   $value  

[ Top ]

method setMaxNumRows [line 493]

void setMaxNumRows( value $value)

Sets the Maximum number of Legend Rows displayed for a horizontal Legend (Chart Top or Bottom).
Default value: 10



Tags:

access:  public


Parameters:

value   $value   int

[ Top ]

method setResizeChart [line 614]

void setResizeChart( value $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.
Default value: true




Tags:

access:  public


Parameters:

value   $value   boolean

[ Top ]

method setSeries [line 195]

void setSeries( value $value)

Determines which series is used as data for the Legend entries.




Tags:

access:  public


Parameters:

value   $value   Series

[ Top ]

method setSymbol [line 313]

void setSymbol( $value)



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method setText [line 519]

void setText( value $value)

Adds text to the Legend.



Tags:

access:  public


Overrides TextShape::setText() (Displays customized strings inside Shapes.
)

Parameters:

value   $value   String

[ Top ]

method setTextAlign [line 164]

void setTextAlign( $value)



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method setTextStyle [line 157]

void setTextStyle( value $value)

Specifies how Legend text items will be formatted.
Default value: LeftValue



Tags:

access:  public


Parameters:

value   $value   LegendTextStyle

[ Top ]

method setTopLeftPos [line 471]

void setTopLeftPos( value $value)

Specifies the Legend's top position in percent of total chart height.
Default value: 10



Tags:

access:  public


Parameters:

value   $value   int

[ Top ]

method setVertMargin [line 590]

void setVertMargin( value $value)

Determines the vertical margin in pixels between Legend and Chart rectangle.
Default value: 0



Tags:

access:  public


Parameters:

value   $value   int

[ Top ]

method setVertSpacing [line 539]

void setVertSpacing( value $value)

Determines the vertical spacing between Legend items (pixels).
Default value: 0



Tags:

access:  public


Parameters:

value   $value   int

[ Top ]

method _clicked [line 712]

int _clicked( p $p)

Returns the index of the clicked Legend Point.



Tags:

access:  public


Parameters:

p   $p   Point

[ Top ]

method __get [line 71]

void __get( $property)



Overrides TextShapePosition::__get() (parent method not documented)

Parameters:

   $property  

[ Top ]

method __set [line 78]

void __set( $property, $value)



Overrides TextShapePosition::__set() (parent method not documented)

Parameters:

   $property  
   $value  

[ Top ]


Documentation generated on Thu, 18 Dec 2008 13:11:23 +0100 by phpDocumentor 1.4.1