Chart FX 7 for Java Server

com.softwarefx.chartfx.server
Class CustomLegendItem

java.lang.Object
  extended by com.softwarefx.chartfx.server.CustomLegendItem
All Implemented Interfaces:
ILegendBoxItem

public class CustomLegendItem
extends Object
implements ILegendBoxItem

Provides access to the customization features for a particular CustomLegendItem.

A CustomLegendItem is an additional item added to the legend of a chart that contains relevant information to explain what is being depicted in a chart.

The CustomLegendItem fills the void when the series legend and values cannot convey the desired information. The supported members of the CustomLegendItem allow you to configure and add extra legend items to the standard legend box.

The CustomLegendItem needs to be created and added to the chart, as shown in the following example:

CustomLegendItem c = new CustomLegendItem();
c.setText("Custom Legend Item");
c.setMarkerShape(MarkerShape.MARBLE);
c.setColor(java.awt.Color.ORANGE);
chart1.getLegendBox().getCustomItems().add(c);


Constructor Summary
CustomLegendItem()
           
 
Method Summary
 Color getAlternateColor()
          Gets the AlternateColor.
 PointAttributes getAttributes()
          Gets the Attributes.
 BorderAttributes getBorder()
          Gets a BorderAttributes object allowing you to modify the border properties for this CustomLegendItem.
 Color getColor()
          Gets the Color.
 Link getLink()
          Gets the Linkobject allowing you to associate a url to a CustomLegendItem.
 MarkerShape getMarkerShape()
          Gets the MarkerShape.
 HatchStyle getPattern()
          Gets the Pattern.
 Image getPicture()
          Gets the Picture.
 String getText()
          Gets the Text.
 boolean isShowLine()
          Gets the ShowLine.
 void setAlternateColor(Color value)
          Sets the background color of a custom legend item marker when a pattern is configured using the Pattern property.
 void setAttributes(PointAttributes value)
          Sets the PointAttributes object for the custom legend item.
 void setColor(Color value)
          Sets the Color for the marker of the Custom Legend Item.
 void setMarkerShape(MarkerShape value)
          Represents the shape of the marker.
 void setPattern(HatchStyle value)
          Sets a HatchStyle pattern for the marker of a CustomLegendItem.
 void setPicture(Image value)
          Sets an image to be used as a marker for a CustomLegendItem.
 void setShowLine(boolean value)
          Sets a value used to display a line marker for a CustomLegendItem.
 void setText(String value)
          Sets the text string of the custom legend item.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomLegendItem

public CustomLegendItem()
Method Detail

getAlternateColor

public Color getAlternateColor()

Gets the AlternateColor. For more detail see setAlternateColor(java.awt.Color).


getAttributes

public PointAttributes getAttributes()

Gets the Attributes. For more detail see setAttributes(com.softwarefx.chartfx.server.PointAttributes).


getBorder

public BorderAttributes getBorder()

Gets a BorderAttributes object allowing you to modify the border properties for this CustomLegendItem.

Remarks:
  • Below, the border color for the custom legend item is set to Black:

  • See Also:
    setColor(java.awt.Color), getLink(), setPicture(java.awt.Image), setText(java.lang.String), BorderAttributes

    getColor

    public Color getColor()

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


    getLink

    public Link getLink()

    Gets the Linkobject allowing you to associate a url to a CustomLegendItem.

    Remarks:
  • Developers may obtain the Link object for a PointAttributes item using this property. Using the supported Link Class members, developers may configure a Link.setUrl(java.lang.String) and Link.setTarget(java.lang.String) for the object.

  • See Also:
    Link

    getMarkerShape

    public MarkerShape getMarkerShape()

    Gets the MarkerShape. For more detail see setMarkerShape(com.softwarefx.chartfx.server.MarkerShape).


    getPattern

    public HatchStyle getPattern()

    Gets the Pattern. For more detail see setPattern(com.softwarefx.HatchStyle).


    getPicture

    public Image getPicture()

    Gets the Picture. For more detail see setPicture(java.awt.Image).


    getText

    public String getText()

    Gets the Text. For more detail see setText(java.lang.String).


    isShowLine

    public boolean isShowLine()

    Gets the ShowLine. For more detail see setShowLine(boolean).


    setAlternateColor

    public void setAlternateColor(Color value)

    Sets the background color of a custom legend item marker when a pattern is configured using the Pattern property.

    Remarks:
  • The forecolor of the pattern is configured using the setColor(java.awt.Color) property.

  • Named colors are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").

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

  • See Also:
    setColor(java.awt.Color), setMarkerShape(com.softwarefx.chartfx.server.MarkerShape)

    setAttributes

    public void setAttributes(PointAttributes value)

    Sets the PointAttributes object for the custom legend item.

    Remarks:
  • The Attributes property is used to obtain the PointAttributes object for a CustomLegendItem. This allows the developer to apply unique visual attributes for the legend item.

  • Please see the the PointAttributes Class for additional information regarding the supported members.

  • See Also:
    SeriesAttributes, PointAttributes

    setColor

    public void setColor(Color value)

    Sets the Color for the marker of the Custom Legend Item.

    Remarks:
  • Named colors are supported (e.g. Red), to use Hex notation you have to use quotes (e.g. "#FF00FF").

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


  • setMarkerShape

    public void setMarkerShape(MarkerShape value)

    Represents the shape of the marker.

    Remarks:
  • If you hide the markers using the MarkerShape.NONE property, labels will be numbered.

  • The MarkerShape BorderAttributes may be configured by accessing the getBorder() property.

  • See Also:
    setPicture(java.awt.Image), setPattern(com.softwarefx.HatchStyle)

    setPattern

    public void setPattern(HatchStyle value)

    Sets a HatchStyle pattern for the marker of a CustomLegendItem.

    Remarks:
  • The forecolor of the pattern is configured using the setColor(java.awt.Color) property. The background color of the pattern is configured using the setAlternateColor(java.awt.Color) property.

  • These are the supported styles:

    Horizontal
    Min
    Vertical
    ForwardDiagonal
    BackwardDiagonal
    Cross
    LargeGrid
    Max
    DiagonalCross
    Percent05
    Percent10
    Percent20
    Percent25
    Percent30
    Percent40
    Percent50
    Percent60
    Percent70
    Percent75
    Percent80
    Percent90
    LightDownwardDiagonal
    LightUpwardDiagonal
    DarkDownwardDiagonal
    DarkUpwardDiagonal
    WideDownwardDiagonal
    WideUpwardDiagonal
    LightVertical
    LightHorizontal
    NarrowVertical
    NarrowHorizontal
    DarkVertical
    DarkHorizontal
    DashedDownwardDiagonal
    DashedUpwardDiagonal
    DashedHorizontal
    DashedVertical
    SmallConfetti
    LargeConfetti
    ZigZag
    Wave
    DiagonalBrick
    HorizontalBrick
    Weave
    Plaid
    Divot
    DottedGrid
    DottedDiamond
    Shingle
    Trellis
    Sphere
    SmallGrid
    SmallCheckerBoard
    LargeCheckerBoard
    OutlinedDiamond
    SolidDiamond

  • See HatchStyle in the Java API .

  • See Also:
    setPicture(java.awt.Image), setMarkerShape(com.softwarefx.chartfx.server.MarkerShape)

    setPicture

    public void setPicture(Image value)

    Sets an image to be used as a marker for a CustomLegendItem.

    Remarks:
  • Setting this property will override any settings configured using the setMarkerShape(com.softwarefx.chartfx.server.MarkerShape) property.

  • See Also:
    setPattern(com.softwarefx.HatchStyle), setMarkerShape(com.softwarefx.chartfx.server.MarkerShape), PointAttributes.setPicture(java.awt.Image)

    setShowLine

    public void setShowLine(boolean value)

    Sets a value used to display a line marker for a CustomLegendItem.

    Remarks:
  • The setMarkerShape(com.softwarefx.chartfx.server.MarkerShape) property may be used in combination with this property to display a different marker shape.

  • Below, the ShowLine property from the custom legend item is set to true:

  • See Also:
    setMarkerShape(com.softwarefx.chartfx.server.MarkerShape)

    setText

    public void setText(String value)

    Sets the text string of the custom legend item.

    Remarks:
  • The Text property of the LegendBox object is used to access the CustomLegendItemCollection object of a chart. By accessing a CustomLegendItem from the collection, you can modify the text of the item using this property.

  • The LegendItemAttributes.setTextColor(java.awt.Color) property is used to control the color for a legend's text.

  • See Also:
    LegendItemAttributes.setTextColor(java.awt.Color), LegendBox

    http://www.softwarefx.com

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