Chart FX for Java 6.5

SoftwareFX.ChartFX.Statistical
Class Legend

java.lang.Object
  extended by SoftwareFX.ChartFX.Statistical.Legend

public final class Legend
extends java.lang.Object

Provides access to the Legend object.

The statistical legend is not only used to display statistical analysis values, but also allows your end users to interact with any interactive studies applied to the chart. The supported members of this class allow you to apply visual attributes to the statistical legend.


Constructor Summary
Legend()
           
 
Method Summary
 java.awt.Color getBackColor()
          Gets the BackColor.
 int getDocked()
          Gets the Docked.
 java.awt.Font getFont()
          Gets the Font.
 int getHeight()
          Gets the Height.
 java.awt.Color getTextColor()
          Gets the TextColor.
 int getWidth()
          Gets the Width.
 void invalidate()
          Invalidates the legend and causes a paint message to be sent to the legend.
 boolean isAutoSize()
          Gets the AutoSize.
 boolean isDrawingArea()
          Gets the DrawingArea.
 boolean isShowValues()
          Gets the ShowValues.
 boolean isVisible()
          Gets the Visible.
 void setAutoSize(boolean value)
          Gets or sets a value indicating whether Chart FX will calculate the best-fit size for legend box.
 void setBackColor(java.awt.Color value)
          Gets or sets the background color for the selected legend box.
 void setDocked(int value)
          Gets or sets the position for the selected legend box.
 void setDrawingArea(boolean value)
          Gets or sets a value indicating whether the legend box margins to go outside of the chart's drawing area.
 void setFont(java.awt.Font value)
          Gets or sets the font for the legend box text.
 void setHeight(int value)
          Gets or sets the height for the legend box when docked or fixed.
 void setShowValues(boolean value)
          Gets or sets a value indicating whether or not values will be shown in the Statistical Legend for present analysis studies.
 void setTextColor(java.awt.Color value)
          Gets or sets the text color for the legend box.
 void setVisible(boolean value)
          Gets or sets a value indicating whether the legend box is visible in the chart.
 void setWidth(int value)
          Gets or sets the width for the legend box when docked or fixed.
 void sizeToFit()
          Calculates and sets the best-fit size for the legend.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Legend

public Legend()
Method Detail

getBackColor

public java.awt.Color getBackColor()

Gets the BackColor. For more detail see setBackColor(java.awt.Color).


getDocked

public int getDocked()

Gets the Docked. For more detail see setDocked(int).


getFont

public java.awt.Font getFont()

Gets the Font. For more detail see setFont(java.awt.Font).


getHeight

public int getHeight()

Gets the Height. For more detail see setHeight(int).


getTextColor

public java.awt.Color getTextColor()

Gets the TextColor. For more detail see setTextColor(java.awt.Color).


getWidth

public int getWidth()

Gets the Width. For more detail see setWidth(int).


invalidate

public void invalidate()

Invalidates the legend and causes a paint message to be sent to the legend.

Remarks:
  • When you modify a visual attribute of a selected legend, sometimes it requires that the legend be recalculated and repainted to display the legend as desired. Calling this method after customization will ensure new changes are visible.

  • See Also:
    Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    isAutoSize

    public boolean isAutoSize()

    Gets the AutoSize. For more detail see setAutoSize(boolean).


    isDrawingArea

    public boolean isDrawingArea()

    Gets the DrawingArea. For more detail see setDrawingArea(boolean).


    isShowValues

    public boolean isShowValues()

    Gets the ShowValues. For more detail see setShowValues(boolean).


    isVisible

    public boolean isVisible()

    Gets the Visible. For more detail see setVisible(boolean).


    setAutoSize

    public void setAutoSize(boolean value)

    Gets or sets a value indicating whether Chart FX will calculate the best-fit size for legend box.

    Remarks:
  • When the user moves a legend from a docked position to another (e.g. Docked-Right to Docked Top), The legend must be resized accordingly to fit all the labels associated with the legend being shown. When this property is set to True, you will not need to set the legend Width or Height as Chart FX will calculate those values for you.

  • If you wish to manually adjust the legend setHeight(int) and setWidth(int), this property will need to be set to false.

  • See Also:
    setHeight(int), setWidth(int), sizeToFit(), Statistics

    setBackColor

    public void setBackColor(java.awt.Color value)

    Gets or sets the background color for the selected legend box.

    Remarks:
  • You can control the position of the legend using the setDocked(int) property.

  • The setFont(java.awt.Font) property may be used to assign a Font object to be utilized by the legend text.

  • For more information regarding the Color type, please refer to your development environment documentation.

  • See Also:
    setDocked(int), setFont(java.awt.Font), Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    setDocked

    public void setDocked(int value)

    Gets or sets the position for the selected legend box.

    Remarks:
  • You may change the size of a tool with the setWidth(int) and setHeight(int) properties, however, you must first set the setAutoSize(boolean) property to false so the setting takes affect.

  • See Also:
    setAutoSize(boolean), setHeight(int), setWidth(int), Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    setDrawingArea

    public void setDrawingArea(boolean value)

    Gets or sets a value indicating whether the legend box margins to go outside of the chart's drawing area.

    Remarks:
  • By default the legends are drawn inside the chart drawing area, for example when the legend box is at the right, the first legend will be at the top of the chart area, it will not use the margin on top. If you set DrawingArea to false, the margins will also be available for the legend.

  • If there is enough space and the legend is centered (default), there will be no noticeable difference when this property is configured. The difference is visible when there are many legend values, the drawing area is too small, the opposite gaps (e.g. top and bottom) are different or the legend is not centered.

  • See Also:
    Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    setFont

    public void setFont(java.awt.Font value)

    Gets or sets the font for the legend box text.

    Remarks:
  • When setting a font, you must create a new font object with the desired attributes and assign that object to the desired chart element every time you want to change the font.

  • For more information regarding the Font type, please refer to your development environment documentation.

  • See Also:
    Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    setHeight

    public void setHeight(int value)

    Gets or sets the height for the legend box when docked or fixed.

    Remarks:
  • For a docked legend, the Height property applies only when it is docked to the top or bottom margin. The height can always be modified when the legend is fixed inside the chart area.

  • When you modify the height of a particular legend, the setAutoSize(boolean) property must be set to False; Even if you move the legend from a docked to a fixed position or viceversa, Chart FX will not recalculate the best-fit height for the legend unless the AutoSize property is set to True.

  • The setWidth(int) property can be used to set the width of the legend box.

  • See Also:
    setWidth(int), Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), setAutoSize(boolean), Statistics

    setShowValues

    public void setShowValues(boolean value)

    Gets or sets a value indicating whether or not values will be shown in the Statistical Legend for present analysis studies.

    Remarks:
  • By default the statistical legend will display the values of present studies. If multiple data series are present in the chart, it may be neccessary to highlight a series or configure the Statistics.setSelectedSeries(int) property.

  • See Also:
    Statistics.setSelectedSeries(int)

    setTextColor

    public void setTextColor(java.awt.Color value)

    Gets or sets the text color for the legend box.

    Remarks:
  • For more information regarding the Color type, please refer to your development environment documentation.

  • See Also:
    Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    setVisible

    public void setVisible(boolean value)

    Gets or sets a value indicating whether the legend box is visible in the chart.

    Remarks:
  • Hiding a tool does not destroy nor lose previous settings assigned by other properties.

  • The Statistics.setLegendBox(boolean) property is used to display the legend box in the chart as well.

  • See Also:
    Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    setWidth

    public void setWidth(int value)

    Gets or sets the width for the legend box when docked or fixed.

    Remarks:
  • For a Docked legend, the Width property applies only when it is docked to the right or left margin. The width can always be modified when the legend is fixed inside the chart area.

  • When you modify the width of a particular legend, the setAutoSize(boolean) property must be set to False; Even if you move the legend from a docked to a fixed position or viceversa, Chart FX will not recalculate the best-fit width for the legend unless the AutoSize property is set to True.

  • The setHeight(int) property can be used to set the height of the legend box.

  • See Also:
    setAutoSize(boolean), setHeight(int), Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    sizeToFit

    public void sizeToFit()

    Calculates and sets the best-fit size for the legend.

    Remarks:
  • This method is particularly useful when the setAutoSize(boolean) property is set to False, as it will allow you to recalculate the best-fit size for the selected tool without setting the AutoSize property to True.

  • See Also:
    setAutoSize(boolean), Statistics.setLegendBox(boolean), Statistics.getLegendBoxObj(), Statistics

    http://www.softwarefx.com

    2007 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.