Chart FX for Java 6.2

SoftwareFX.ChartFX
Class UserLegendBox

java.lang.Object
  extended bySoftwareFX.ChartFX.UserLegendBox

public final class UserLegendBox
extends java.lang.Object

Provides access to the UserLegendBox object.

A legend box is a tool within a chart that contains relevant information to explain what is being depicted in a chart. The user legend box is a chart legend that a developer must configure all legend keys manually. Thus, the user legend box fills the void when a legend is needed, but the series legend and values legends cannot convey the desired information.

The supported members of the UserLegendBox class allow you to configure and control a legend box any way you feel will benefit the end user of your chart.


Constructor Summary
UserLegendBox()
           
 
Method Summary
 void clear()
          Clears the user legend of all configured settings and values.
 int getAlignment()
          Allows you to align the selected legend box object.
 java.awt.Color getBackColor()
          Allows you to set the background color for the selected legend box.
 IAdornment getBorderObject()
          Gets or sets a default or image border to the legend.
 int getDocked()
          Sets the position for the selected legend box.
 int getFlags()
          Allows you to assign style attributes to a selected legend box object.
 java.awt.Font getFont()
          Allows you to set the font for a selected legend box text.
 int getHeight()
          Sets the height for a selected legend box object when it is docked or fixed in the chart.
 HighlightToolSettings getHighlight()
          Returns a HighlightToolSettings object for a selected legend.
 UserLegendBoxItemCollection getItem()
          Allows you to assign attributes directly to a selected user legend box key.
 UserLegendBoxItem getItem(int i)
          Deprecated. You should use getItem() instead.
 java.awt.Color getTextColor()
          Used to change the text color for the selected legend box object.
 TitleDockable getTitle(int n)
          Deprecated. You should use getTitles() instead.
 TitleCollection getTitles()
          Returns or sets a title object for the selected legend box.
 TitleDockable getTitles(int n)
          Deprecated. You should use getTitles() instead.
 int getToolBorder()
          Used to specify the style of the border for the selected legend box object.
 int getWidth()
          Allows you to set the width for a selected legend box object.
 void invalidate()
          Invalidates the selected legend and causes a paint message to be sent to the legend.
 boolean isAutoContourLabels()
          Instruct Chart FX to automatically create contour labels for the chart user legend.
 boolean isAutoSize()
          Allows Chart FX to calculate the best-fit size according to the selected legend box position.
 boolean isContinuous()
          Sets the key markers of the user legend box as a single continuous bar with no borders.
 boolean isDrawingArea()
          Allows the legend box margins to go outside of the chart's drawing area.
 boolean isEmpty()
          IsEmptyTrue
 boolean isShowMarkers()
          Allows you to show or hide the markers in the user legend box.
 boolean isVisible()
          Shows or hides a selected legend box object.
 void setAlignment(int value)
          Allows you to align the selected legend box object.
 void setAutoContourLabels(boolean value)
          Instruct Chart FX to automatically create contour labels for the chart user legend.
 void setAutoSize(boolean value)
          Allows Chart FX to calculate the best-fit size according to the selected legend box position.
 void setBackColor(java.awt.Color value)
          Allows you to set the background color for the selected legend box.
 void setBorderObject(IAdornment value)
          Gets or sets a default or image border to the legend.
 void setContinuous(boolean value)
          Sets the key markers of the user legend box as a single continuous bar with no borders.
 void setDocked(int value)
          Sets the position for the selected legend box.
 void setDrawingArea(boolean value)
          Allows the legend box margins to go outside of the chart's drawing area.
 void setEmpty(boolean value)
          A boolean value specifying whether the user legend has been assigned any attributes or not.
 void setFlags(int value)
          Allows you to assign style attributes to a selected legend box object.
 void setFont(java.awt.Font value)
          Allows you to set the font for a selected legend box text.
 void setHeight(int value)
          Sets the height for a selected legend box object when it is docked or fixed in the chart.
 void setShowMarkers(boolean value)
          Allows you to show or hide the markers in the user legend box.
 void setTextColor(java.awt.Color value)
          Used to change the text color for the selected legend box object.
 void setToolBorder(int value)
          Used to specify the style of the border for the selected legend box object.
 void setVisible(boolean value)
          Shows or hides a selected legend box object.
 void setWidth(int value)
          Allows you to set the width for a selected legend box object.
 void sizeToFit()
          Calculates and sets the best-fit size for the UserLegendBox.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserLegendBox

public UserLegendBox()
Method Detail

clear

public void clear()

Clears the user legend of all configured settings and values.

Remarks:
  • Using this method will clear the user legend of any attributes set using the getItem(int) property. The attributes include UserLegendBoxItem.setBorderEffect(int), UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setKeyLabel(java.lang.String), UserLegendBoxItem.setLabel(java.lang.String) and/or UserLegendBoxItem.setMarkerShape(int).

  • To check to see if the user legend has any configured settings or values, you can use the setEmpty(boolean) property.

  • See Also:
    UserLegendBoxItem.setBorderEffect(int), UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setKeyLabel(java.lang.String), UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setMarkerShape(int), UserLegendBoxItem

    getAlignment

    public int getAlignment()

    Allows you to align the selected legend box object.

    Values:
    ToolAlignment : Defines the alignment of the selected Chart FX tool in the chart.
    ValueDescription
    SPREADStretches the selected tool in the configured position.
    NEARLeft justifies the selected tool in the configured position.
    CENTERCenters the selected tool in the configured position.
    FARRight justifies the selected tool in the configured position.

    Remarks:
  • You must make selected legend box object visible in order to see any of the visual attributes added using the properties of the LegendBox class.

  • The background color of the selected legend box may be modified using the LegendBox.setBackColor(java.awt.Color) property.

  • Using the LegendBox.setDocked(int) property, you can dock the selected legend box in different areas of the chart.

  • See Also:
    LegendBox.setAutoSize(boolean), LegendBox.setBackColor(java.awt.Color), LegendBox.setDocked(int), LegendBox.setTextColor(java.awt.Color), LegendBox.getTitles(), LegendBox.setWidth(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    getBackColor

    public java.awt.Color getBackColor()

    Allows you to set the background color for the selected legend box.

    Remarks:
  • When using a background image, you may want to assign a transparent BackColor to the selected legend box object.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • See Also:
    Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    getBorderObject

    public IAdornment getBorderObject()

    Gets or sets a default or image border to the legend.

    Remarks:
  • This property allows users to assign attributes directly to the border object of the legend.

  • The Chart FX ImageBorders use shading to give a multidimensional effect. The Chart.setPageColor(java.awt.Color) property can be used to modify the background color of the shaded area around ImageBorders.

  • The DataEditor and Chart classes also support this property for border assignment to those objects.

  • See Also:
    Chart.setPageColor(java.awt.Color), DataEditor, Chart

    getDocked

    public int getDocked()

    Sets the position for the selected legend box.

    Values:
    Docked : Define how to set the selected tool position (docked, floating or fixed).
    ValueDescription
    TOPDocks the selected tool to the top margin.
    BOTTOMDocks the selected tool to the bottom margin.
    LEFTDocks the selected tool to the left margin.
    RIGHTDocks the selected tool to the right margin.

    Remarks:
  • When a selected legend box is docked to a margin you can use the LegendBox.setToolBorder(int) property to set the border style.

  • You may change the size of a tool with the LegendBox.setWidth(int) and LegendBox.setHeight(int) properties.

  • You can also change the alignment of the selected legend box using the LegendBox.setAlignment(int) property.

  • See Also:
    LegendBox.setAutoSize(boolean), LegendBox.setToolBorder(int), LegendBox.setWidth(int), LegendBox.setHeight(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Toolbar, DataEditor

    getFlags

    public int getFlags()

    Allows you to assign style attributes to a selected legend box object.

    Values:
    LegendBoxFlag : Allows you to specify the style for a legend.
    ValueDescription
    WORD_BREAKWraps text when the legend alignment is set to spread.
    SKIP_EMPTYPrevents from displaying empty legends.
    SHOW_MENUEnables the context menu for the legend.
    RIGHT_ALIGNRight aligns the text in the legend. Used with Languages written from right to left.
    NO_COLORNo Colors are used for markers in legend.
    INVERTEDSwitches the order of the keys in legend.
    DEFAULTDefault legend settings.

    Remarks:
  • This property uses bitwise operators to turn on and off the Flags settings. To combine two flags for a selected legend use the 'Or' bitwise operator:

    chart1.getLegendBoxObj().setFlags(chart1.getLegendBoxObj().getFlags() | LegendBoxFlag.INVERTED | LegendBoxFlag.RIGHT_ALIGN);

  • See Also:
    Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    getFont

    public java.awt.Font getFont()

    Allows you to set the font for a selected legend box text.

    Remarks:
  • You can set the font for the entire chart using the Chart.setFont(java.awt.Font) property.

  • When setting a font in Chart FX, 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 the Java API Documentation.

  • See Also:
    LegendBox.getTitles(), LegendBox.setTextColor(java.awt.Color), Chart.setFont(java.awt.Font), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    getHeight

    public int getHeight()

    Sets the height for a selected legend box object when it is docked or fixed in the chart.

    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 LegendBox.setAutoSize(boolean) property will be set to False and 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.

  • See Also:
    LegendBox.setDocked(int), LegendBox.setAutoSize(boolean), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), DataEditor

    getHighlight

    public HighlightToolSettings getHighlight()

    Returns a HighlightToolSettings object for a selected legend.

    Remarks:
  • This property returns a HighlightToolSettings object, so you may customize how the Legend displays a highlighted chart element. Please see the supported members of the HighlightToolSettings class for more information.

  • See Also:
    HighlightToolSettings

    getItem

    public UserLegendBoxItem getItem(int i)
    Deprecated. You should use getItem() instead.

    See Also:
    UserLegendBoxItemCollection

    getItem

    public UserLegendBoxItemCollection getItem()

    Allows you to assign attributes directly to a selected user legend box key.

    Remarks:
  • The Item object is a zero based array which allows you to create and assign attributes to each key that will exist in the user legend box.

  • Every key in the user legend will have an Item index.

  • Please refer to UserLegendBoxItem class for the supported properties.

  • See Also:
    UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setBorderEffect(int), UserLegendBoxItem.setColor(java.awt.Color), UserLegendBoxItem.setKeyLabel(java.lang.String), UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setMarkerShape(int), UserLegendBoxItem

    getTextColor

    public java.awt.Color getTextColor()

    Used to change the text color for the selected legend box object.

    Remarks:
  • Before you can see the text color assignments, the selected legend box must be visible.Axis.getLabel(int)Chart.getLegend(int)

  • You can assign the text for the values legend box using the Axis.getLabel(int) or Chart.getLegend(int) properties. The Chart.getSerLeg(int) property allows you to add keys to a series legend box, and the UserLegendBoxItem.setLabel(java.lang.String) property allows you to set keys for the user legend box.

  • This property does not change the color of legend box titles, please refer to the Title members.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • See Also:
    LegendBox.setFont(java.awt.Font), Axis.getLabel(int), Chart.getLegend(int), LegendBox.getTitles(), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Axis, Chart, Title

    getTitle

    public TitleDockable getTitle(int n)
    Deprecated. You should use getTitles() instead.


    getTitles

    public TitleCollection getTitles()

    Returns or sets a title object for the selected legend box.

    Remarks:
  • Please refer to Title class members to modify other attributes of the title object.

  • See Also:
    Title.setTextColor(java.awt.Color), Title.setText(java.lang.String), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Title, Chart

    getTitles

    public TitleDockable getTitles(int n)
    Deprecated. You should use getTitles() instead.


    getToolBorder

    public int getToolBorder()

    Used to specify the style of the border for the selected legend box object.

    Values:
    ToolBorder : Set the border style for the tool object selected.
    ValueDescription
    NONENo border used.
    EXTERNALExternal border used for the tool object.
    INTERNALInternal border used for the tool object.

    Remarks:
  • Allows you to specify the border for a selected legend box to be External, Internal or none.

  • See Also:
    LegendBox.setDocked(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), DataEditor

    getWidth

    public int getWidth()

    Allows you to set the width for a selected legend box object.

    Remarks:
  • The LegendBox.setHeight(int) property will allow you to manually adjust the height of the legend box. Both the Height and Width properties are configured in units of pixels.

  • You can use the LegendBox.setAutoSize(boolean) property to allow Chart FX to calculate the best-fit size according to the selected legend box position. If this property is set to True, manual width adjustments will be ignored.

  • For a LegendBox.setDocked(int) 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.

  • See Also:
    LegendBox.setAutoSize(boolean), LegendBox.setDocked(int), LegendBox.setHeight(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    invalidate

    public void invalidate()

    Invalidates the selected 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:
    Chart.setLegendBox(boolean), Chart.setSerLegBox(boolean), Chart.setUserLegendBox(boolean), Chart

    isAutoContourLabels

    public boolean isAutoContourLabels()

    Instruct Chart FX to automatically create contour labels for the chart user legend.

    Remarks:
  • When set to True, Chart FX will automatically generate contour labels based the chart data when the Chart.closeData(int) method is called.

  • You must make the Chart.setUserLegendBox(boolean) visible in order to view the contour labels created.

  • Use the Chart.setGallery(int) property to set the chart type to Contour.

  • See Also:
    Chart.setUserLegendBox(boolean), Chart.closeData(int), Chart

    isAutoSize

    public boolean isAutoSize()

    Allows Chart FX to calculate the best-fit size according to the selected legend box position.

    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 LegendBox.setWidth(int) or LegendBox.setHeight(int) as Chart FX will calculate those values for you.

  • See Also:
    LegendBox.setWidth(int), LegendBox.setHeight(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), DataEditor

    isContinuous

    public boolean isContinuous()

    Sets the key markers of the user legend box as a single continuous bar with no borders.

    Remarks:
  • This property is particularly useful when creating legends for Contour charts. A contour chart uses colors to show the intensity of a value and not the different series. The continuous property helps create a user legend that relays the color and order information clearly.Chart.setLegendBox(boolean)Chart.setUserLegendBox(boolean)

  • The ShowMarkers property must be set to True in order to see the continuous attribute applied to a user legend.

  • See Also:
    Chart.setUserLegendBox(boolean), Chart.getUserLegendBoxObj(), setShowMarkers(boolean), UserLegendBoxItem, Chart

    isDrawingArea

    public boolean isDrawingArea()

    Allows 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:
    Chart.setLegendBox(boolean), Chart.getLegendBoxObj(), Chart

    isEmpty

    public boolean isEmpty()
    IsEmptyTrue

    Returns a boolean value specifying whether the user legend has been assigned any attributes or not.

    Remarks:
  • When the return value of this property is True, the user legend has not been assigned any attributes. If False, the user legend has been configured with supported attributes.

  • See Also:
    UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setKeyLabel(java.lang.String), clear(), UserLegendBoxItem

    isShowMarkers

    public boolean isShowMarkers()

    Allows you to show or hide the markers in the user legend box.

    Remarks:
  • This property can aid in chart readability by associating a legend key with a series color.

  • When you hide the markers by turning this property to False, the configured UserLegendBoxItem.setKeyLabel(java.lang.String) string is displayed.

  • See Also:
    UserLegendBoxItem.setKeyLabel(java.lang.String), setContinuous(boolean), UserLegendBoxItem

    isVisible

    public boolean isVisible()

    Shows or hides a selected legend box object.

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

  • You may also use the Chart.setLegendBox(boolean), Chart.setSerLegBox(boolean) or Chart.setUserLegendBox(boolean) properties to make the selected legend box visible.

  • See Also:
    Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart.setLegendBox(boolean), Chart.setSerLegBox(boolean), Chart.setUserLegendBox(boolean), Chart, Toolbar, DataEditor

    setAlignment

    public void setAlignment(int value)

    Allows you to align the selected legend box object.

    Values:
    ToolAlignment : Defines the alignment of the selected Chart FX tool in the chart.
    ValueDescription
    SPREADStretches the selected tool in the configured position.
    NEARLeft justifies the selected tool in the configured position.
    CENTERCenters the selected tool in the configured position.
    FARRight justifies the selected tool in the configured position.

    Remarks:
  • You must make selected legend box object visible in order to see any of the visual attributes added using the properties of the LegendBox class.

  • The background color of the selected legend box may be modified using the LegendBox.setBackColor(java.awt.Color) property.

  • Using the LegendBox.setDocked(int) property, you can dock the selected legend box in different areas of the chart.

  • See Also:
    LegendBox.setAutoSize(boolean), LegendBox.setBackColor(java.awt.Color), LegendBox.setDocked(int), LegendBox.setTextColor(java.awt.Color), LegendBox.getTitles(), LegendBox.setWidth(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    setAutoContourLabels

    public void setAutoContourLabels(boolean value)

    Instruct Chart FX to automatically create contour labels for the chart user legend.

    Remarks:
  • When set to True, Chart FX will automatically generate contour labels based the chart data when the Chart.closeData(int) method is called.

  • You must make the Chart.setUserLegendBox(boolean) visible in order to view the contour labels created.

  • Use the Chart.setGallery(int) property to set the chart type to Contour.

  • See Also:
    Chart.setUserLegendBox(boolean), Chart.closeData(int), Chart

    setAutoSize

    public void setAutoSize(boolean value)

    Allows Chart FX to calculate the best-fit size according to the selected legend box position.

    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 LegendBox.setWidth(int) or LegendBox.setHeight(int) as Chart FX will calculate those values for you.

  • See Also:
    LegendBox.setWidth(int), LegendBox.setHeight(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), DataEditor

    setBackColor

    public void setBackColor(java.awt.Color value)

    Allows you to set the background color for the selected legend box.

    Remarks:
  • When using a background image, you may want to assign a transparent BackColor to the selected legend box object.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • See Also:
    Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    setBorderObject

    public void setBorderObject(IAdornment value)

    Gets or sets a default or image border to the legend.

    Remarks:
  • This property allows users to assign attributes directly to the border object of the legend.

  • The Chart FX ImageBorders use shading to give a multidimensional effect. The Chart.setPageColor(java.awt.Color) property can be used to modify the background color of the shaded area around ImageBorders.

  • The DataEditor and Chart classes also support this property for border assignment to those objects.

  • See Also:
    Chart.setPageColor(java.awt.Color), DataEditor, Chart

    setContinuous

    public void setContinuous(boolean value)

    Sets the key markers of the user legend box as a single continuous bar with no borders.

    Remarks:
  • This property is particularly useful when creating legends for Contour charts. A contour chart uses colors to show the intensity of a value and not the different series. The continuous property helps create a user legend that relays the color and order information clearly.Chart.setLegendBox(boolean)Chart.setUserLegendBox(boolean)

  • The ShowMarkers property must be set to True in order to see the continuous attribute applied to a user legend.

  • See Also:
    Chart.setUserLegendBox(boolean), Chart.getUserLegendBoxObj(), setShowMarkers(boolean), UserLegendBoxItem, Chart

    setDocked

    public void setDocked(int value)

    Sets the position for the selected legend box.

    Values:
    Docked : Define how to set the selected tool position (docked, floating or fixed).
    ValueDescription
    TOPDocks the selected tool to the top margin.
    BOTTOMDocks the selected tool to the bottom margin.
    LEFTDocks the selected tool to the left margin.
    RIGHTDocks the selected tool to the right margin.

    Remarks:
  • When a selected legend box is docked to a margin you can use the LegendBox.setToolBorder(int) property to set the border style.

  • You may change the size of a tool with the LegendBox.setWidth(int) and LegendBox.setHeight(int) properties.

  • You can also change the alignment of the selected legend box using the LegendBox.setAlignment(int) property.

  • See Also:
    LegendBox.setAutoSize(boolean), LegendBox.setToolBorder(int), LegendBox.setWidth(int), LegendBox.setHeight(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Toolbar, DataEditor

    setDrawingArea

    public void setDrawingArea(boolean value)

    Allows 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:
    Chart.setLegendBox(boolean), Chart.getLegendBoxObj(), Chart

    setEmpty

    public void setEmpty(boolean value)

    A boolean value specifying whether the user legend has been assigned any attributes or not.

    Remarks:
  • When the return value of this property is True, the user legend has not been assigned any attributes. If False, the user legend has been configured with supported attributes.

  • See Also:
    UserLegendBoxItem.setLabel(java.lang.String), UserLegendBoxItem.setKeyLabel(java.lang.String), clear(), UserLegendBoxItem

    setFlags

    public void setFlags(int value)

    Allows you to assign style attributes to a selected legend box object.

    Values:
    LegendBoxFlag : Allows you to specify the style for a legend.
    ValueDescription
    WORD_BREAKWraps text when the legend alignment is set to spread.
    SKIP_EMPTYPrevents from displaying empty legends.
    SHOW_MENUEnables the context menu for the legend.
    RIGHT_ALIGNRight aligns the text in the legend. Used with Languages written from right to left.
    NO_COLORNo Colors are used for markers in legend.
    INVERTEDSwitches the order of the keys in legend.
    DEFAULTDefault legend settings.

    Remarks:
  • This property uses bitwise operators to turn on and off the Flags settings. To combine two flags for a selected legend use the 'Or' bitwise operator:

    chart1.getLegendBoxObj().setFlags(chart1.getLegendBoxObj().getFlags() | LegendBoxFlag.INVERTED | LegendBoxFlag.RIGHT_ALIGN);

  • See Also:
    Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    setFont

    public void setFont(java.awt.Font value)

    Allows you to set the font for a selected legend box text.

    Remarks:
  • You can set the font for the entire chart using the Chart.setFont(java.awt.Font) property.

  • When setting a font in Chart FX, 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 the Java API Documentation.

  • See Also:
    LegendBox.getTitles(), LegendBox.setTextColor(java.awt.Color), Chart.setFont(java.awt.Font), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    setHeight

    public void setHeight(int value)

    Sets the height for a selected legend box object when it is docked or fixed in the chart.

    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 LegendBox.setAutoSize(boolean) property will be set to False and 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.

  • See Also:
    LegendBox.setDocked(int), LegendBox.setAutoSize(boolean), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), DataEditor

    setShowMarkers

    public void setShowMarkers(boolean value)

    Allows you to show or hide the markers in the user legend box.

    Remarks:
  • This property can aid in chart readability by associating a legend key with a series color.

  • When you hide the markers by turning this property to False, the configured UserLegendBoxItem.setKeyLabel(java.lang.String) string is displayed.

  • See Also:
    UserLegendBoxItem.setKeyLabel(java.lang.String), setContinuous(boolean), UserLegendBoxItem

    setTextColor

    public void setTextColor(java.awt.Color value)

    Used to change the text color for the selected legend box object.

    Remarks:
  • Before you can see the text color assignments, the selected legend box must be visible.Axis.getLabel(int)Chart.getLegend(int)

  • You can assign the text for the values legend box using the Axis.getLabel(int) or Chart.getLegend(int) properties. The Chart.getSerLeg(int) property allows you to add keys to a series legend box, and the UserLegendBoxItem.setLabel(java.lang.String) property allows you to set keys for the user legend box.

  • This property does not change the color of legend box titles, please refer to the Title members.

  • For more information regarding the Color type, please refer to the Java API Documentation.

  • See Also:
    LegendBox.setFont(java.awt.Font), Axis.getLabel(int), Chart.getLegend(int), LegendBox.getTitles(), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Axis, Chart, Title

    setToolBorder

    public void setToolBorder(int value)

    Used to specify the style of the border for the selected legend box object.

    Values:
    ToolBorder : Set the border style for the tool object selected.
    ValueDescription
    NONENo border used.
    EXTERNALExternal border used for the tool object.
    INTERNALInternal border used for the tool object.

    Remarks:
  • Allows you to specify the border for a selected legend box to be External, Internal or none.

  • See Also:
    LegendBox.setDocked(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), DataEditor

    setVisible

    public void setVisible(boolean value)

    Shows or hides a selected legend box object.

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

  • You may also use the Chart.setLegendBox(boolean), Chart.setSerLegBox(boolean) or Chart.setUserLegendBox(boolean) properties to make the selected legend box visible.

  • See Also:
    Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart.setLegendBox(boolean), Chart.setSerLegBox(boolean), Chart.setUserLegendBox(boolean), Chart, Toolbar, DataEditor

    setWidth

    public void setWidth(int value)

    Allows you to set the width for a selected legend box object.

    Remarks:
  • The LegendBox.setHeight(int) property will allow you to manually adjust the height of the legend box. Both the Height and Width properties are configured in units of pixels.

  • You can use the LegendBox.setAutoSize(boolean) property to allow Chart FX to calculate the best-fit size according to the selected legend box position. If this property is set to True, manual width adjustments will be ignored.

  • For a LegendBox.setDocked(int) 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.

  • See Also:
    LegendBox.setAutoSize(boolean), LegendBox.setDocked(int), LegendBox.setHeight(int), Chart.getLegendBoxObj(), Chart.getSerLegBoxObj(), Chart.getUserLegendBoxObj(), Chart

    sizeToFit

    public void sizeToFit()

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

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

  • See Also:
    LegendBox.setAutoSize(boolean), LegendBox

    http://www.softwarefx.com

    2005 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.