All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LegendStyle

@Generated(value="This class was generated", comments="Incorrect and missing API should be reported") public class Legend extends AbstractConfigurationObject
The legend is a box containing explanations for the different elements of a chart. A Highmaps legend by default contains one legend item per series, but if a colorAxis is defined, the axis will be displayed in the legen. Either as a gradient, or as multiple legend items for dataClasses.
Version:
$Id: $Id
Author:
Vaadin
See Also:
  • Constructor Details

    • Legend

      public Legend()

      Constructor for Legend.

    • Legend

      public Legend(Boolean enabled)

      Constructor for Legend.

      Parameters:
      enabled - a Boolean object.
  • Method Details

    • getAlign

      public HorizontalAlign getAlign()

      Getter for the field align.

      Returns:
      a HorizontalAlign object.
      See Also:
    • setAlign

      public void setAlign(HorizontalAlign align)

      The horizontal alignment of the legend box within the chart area. Valid values are left, center and right.

      In the case that the legend is aligned in a corner position, the layout option will determine whether to place it above/below or on the side of the plot area.

      Defaults to: center

      Parameters:
      align - a HorizontalAlign object.
    • getBackgroundColor

      public Color getBackgroundColor()

      Getter for the field backgroundColor.

      Returns:
      a Color object.
      See Also:
    • setBackgroundColor

      public void setBackgroundColor(Color backgroundColor)
      The background color of the legend.
      Parameters:
      backgroundColor - a Color object.
    • getBorderColor

      public Color getBorderColor()

      Getter for the field borderColor.

      Returns:
      a Color object.
      See Also:
    • setBorderColor

      public void setBorderColor(Color borderColor)
      The color of the drawn border around the legend.

      Defaults to: #909090

      Parameters:
      borderColor - a Color object.
    • getBorderRadius

      public Number getBorderRadius()

      Getter for the field borderRadius.

      Returns:
      a Number object.
      See Also:
    • setBorderRadius

      public void setBorderRadius(Number borderRadius)
      The border corner radius of the legend.

      Defaults to: 0

      Parameters:
      borderRadius - a Number object.
    • getBorderWidth

      public Number getBorderWidth()

      Getter for the field borderWidth.

      Returns:
      a Number object.
      See Also:
    • setBorderWidth

      public void setBorderWidth(Number borderWidth)
      The width of the drawn border around the legend.

      Defaults to: 0

      Parameters:
      borderWidth - a Number object.
    • getEnabled

      public Boolean getEnabled()

      Getter for the field enabled.

      Returns:
      a Boolean object.
      See Also:
    • setEnabled

      public void setEnabled(Boolean enabled)
      Enable or disable the legend.

      Defaults to: true

      Parameters:
      enabled - a Boolean object.
    • getFloating

      public Boolean getFloating()

      Getter for the field floating.

      Returns:
      a Boolean object.
      See Also:
    • setFloating

      public void setFloating(Boolean floating)
      When the legend is floating, the plot area ignores it and is allowed to be placed below it.

      Defaults to: false

      Parameters:
      floating - a Boolean object.
    • getItemDistance

      public Number getItemDistance()

      Getter for the field itemDistance.

      Returns:
      a Number object.
      See Also:
    • setItemDistance

      public void setItemDistance(Number itemDistance)
      In a legend with horizontal layout, the itemDistance defines the pixel distance between each item.

      Defaults to: 8

      Parameters:
      itemDistance - a Number object.
    • getItemHiddenStyle

      public Style getItemHiddenStyle()

      Getter for the field itemHiddenStyle.

      Returns:
      a Style object.
      See Also:
    • setItemHiddenStyle

      public void setItemHiddenStyle(Style itemHiddenStyle)
      CSS styles for each legend item when the corresponding series or point is hidden. Only a subset of CSS is supported, notably those options related to text. Properties are inherited from style unless overridden here. Defaults to:
       itemHiddenStyle: {
                      color: '#CCC'
              }
       
      Parameters:
      itemHiddenStyle - a Style object.
    • getItemHoverStyle

      public Style getItemHoverStyle()

      Getter for the field itemHoverStyle.

      Returns:
      a Style object.
      See Also:
    • setItemHoverStyle

      public void setItemHoverStyle(Style itemHoverStyle)
      CSS styles for each legend item in hover mode. Only a subset of CSS is supported, notably those options related to text. Properties are inherited from style unless overridden here. Defaults to:
       itemHoverStyle: {
                      color: '#000'
              }
       
      Parameters:
      itemHoverStyle - a Style object.
    • getItemMarginBottom

      public Number getItemMarginBottom()

      Getter for the field itemMarginBottom.

      Returns:
      a Number object.
      See Also:
    • setItemMarginBottom

      public void setItemMarginBottom(Number itemMarginBottom)
      The pixel bottom margin for each legend item.

      Defaults to: 0

      Parameters:
      itemMarginBottom - a Number object.
    • getItemMarginTop

      public Number getItemMarginTop()

      Getter for the field itemMarginTop.

      Returns:
      a Number object.
      See Also:
    • setItemMarginTop

      public void setItemMarginTop(Number itemMarginTop)
      The pixel top margin for each legend item.

      Defaults to: 0

      Parameters:
      itemMarginTop - a Number object.
    • getItemStyle

      public Style getItemStyle()

      Getter for the field itemStyle.

      Returns:
      a Style object.
      See Also:
    • setItemStyle

      public void setItemStyle(Style itemStyle)
      CSS styles for each legend item. Only a subset of CSS is supported, notably those options related to text.

      Defaults to: { "color": "#333333", "cursor": "pointer", "fontSize": "12px", "fontWeight": "bold" }

      Parameters:
      itemStyle - a Style object.
    • getItemWidth

      public Number getItemWidth()

      Getter for the field itemWidth.

      Returns:
      a Number object.
      See Also:
    • setItemWidth

      public void setItemWidth(Number itemWidth)
      The width for each legend item. This is useful in a horizontal layout with many items when you want the items to align vertically. .
      Parameters:
      itemWidth - a Number object.
    • getLabelFormat

      public String getLabelFormat()

      Getter for the field labelFormat.

      Returns:
      a String object.
      See Also:
    • setLabelFormat

      public void setLabelFormat(String labelFormat)
      A format string for each legend label. Available variables relates to properties on the series, or the point in case of pies.

      Defaults to: {name}

      Parameters:
      labelFormat - a String object.
    • getLabelFormatter

      public String getLabelFormatter()

      getLabelFormatter.

      Returns:
      a String object.
    • setLabelFormatter

      public void setLabelFormatter(String _fn_labelFormatter)

      setLabelFormatter.

      Parameters:
      _fn_labelFormatter - a String object.
    • getLayout

      public LayoutDirection getLayout()

      Getter for the field layout.

      Returns:
      a LayoutDirection object.
      See Also:
    • setLayout

      public void setLayout(LayoutDirection layout)
      The layout of the legend items. Can be one of "horizontal" or "vertical".

      Defaults to: horizontal

      Parameters:
      layout - a LayoutDirection object.
    • getMargin

      public Number getMargin()

      Getter for the field margin.

      Returns:
      a Number object.
      See Also:
    • setMargin

      public void setMargin(Number margin)
      If the plot area sized is calculated automatically and the legend is not floating, the legend margin is the space between the legend and the axis labels or plot area.

      Defaults to: 12

      Parameters:
      margin - a Number object.
    • getMaxHeight

      public Number getMaxHeight()

      Getter for the field maxHeight.

      Returns:
      a Number object.
      See Also:
    • setMaxHeight

      public void setMaxHeight(Number maxHeight)
      Maximum pixel height for the legend. When the maximum height is extended, navigation will show.
      Parameters:
      maxHeight - a Number object.
    • getNavigation

      public LegendNavigation getNavigation()

      Getter for the field navigation.

      Returns:
      a LegendNavigation object.
      See Also:
    • setNavigation

      public void setNavigation(LegendNavigation navigation)

      Options for the paging or navigation appearing when the legend is overflown. When legend.useHTML is enabled, navigation is disabled.

      For demo cases, see the legend.navigation options for basic Highcharts.

      Parameters:
      navigation - a LegendNavigation object.
    • getPadding

      public Number getPadding()

      Getter for the field padding.

      Returns:
      a Number object.
      See Also:
    • setPadding

      public void setPadding(Number padding)
      The inner padding of the legend box.

      Defaults to: 8

      Parameters:
      padding - a Number object.
    • getReversed

      public Boolean getReversed()

      Getter for the field reversed.

      Returns:
      a Boolean object.
      See Also:
    • setReversed

      public void setReversed(Boolean reversed)
      Whether to reverse the order of the legend items compared to the order of the series or data classes as defined in the configuration object.

      Defaults to: false

      Parameters:
      reversed - a Boolean object.
    • getRtl

      public Boolean getRtl()

      Getter for the field rtl.

      Returns:
      a Boolean object.
      See Also:
    • setRtl

      public void setRtl(Boolean rtl)
      Whether to show the symbol on the right side of the text rather than the left side. This is common in Arabic and Hebraic.

      Defaults to: false

      Parameters:
      rtl - a Boolean object.
    • getShadow

      public Boolean getShadow()

      Getter for the field shadow.

      Returns:
      a Boolean object.
      See Also:
    • setShadow

      public void setShadow(Boolean shadow)
      Whether to apply a drop shadow to the legend. A backgroundColor also needs to be applied for this to take effect. The shadow can also be an object configuration containing color, offsetX, offsetY, opacity and width.

      Defaults to: false

      Parameters:
      shadow - a Boolean object.
    • getSymbolHeight

      public Number getSymbolHeight()

      Getter for the field symbolHeight.

      Returns:
      a Number object.
      See Also:
    • setSymbolHeight

      public void setSymbolHeight(Number symbolHeight)
      The pixel height of the legend item symbol. Defaults to font size for regular item symbols as well as for gradient symbols on horizontal color axis and 200 for gradient symbols on vertical color axis.
      Parameters:
      symbolHeight - a Number object.
    • getSymbolPadding

      public Number getSymbolPadding()

      Getter for the field symbolPadding.

      Returns:
      a Number object.
      See Also:
    • setSymbolPadding

      public void setSymbolPadding(Number symbolPadding)
      The pixel padding between the legend item symbol and the legend item text.

      Defaults to: 5

      Parameters:
      symbolPadding - a Number object.
    • getSymbolRadius

      public Number getSymbolRadius()

      Getter for the field symbolRadius.

      Returns:
      a Number object.
      See Also:
    • setSymbolRadius

      public void setSymbolRadius(Number symbolRadius)
      The border radius of the symbol for series types that use a rectangle in the legend.

      Defaults to: 0

      Parameters:
      symbolRadius - a Number object.
    • getSymbolWidth

      public Number getSymbolWidth()

      Getter for the field symbolWidth.

      Returns:
      a Number object.
      See Also:
    • setSymbolWidth

      public void setSymbolWidth(Number symbolWidth)
      The pixel width of the legend item symbol. Defaults to 16 for regular item symbols, 200 for gradient symbols on horizontal color axis and 12 for gradient symbols on vertical color axis.
      Parameters:
      symbolWidth - a Number object.
    • getTitle

      public LegendTitle getTitle()

      Getter for the field title.

      Returns:
      a LegendTitle object.
      See Also:
    • setTitle

      public void setTitle(LegendTitle title)
      A title to be added on top of the legend.
      Parameters:
      title - a LegendTitle object.
    • getUseHTML

      public Boolean getUseHTML()

      Getter for the field useHTML.

      Returns:
      a Boolean object.
      See Also:
    • setUseHTML

      public void setUseHTML(Boolean useHTML)

      Whether to use HTML to render the legend item texts. Prior to 1.1.7, when using HTML, legend.navigation was disabled.

      Defaults to: false

      Parameters:
      useHTML - a Boolean object.
    • getVerticalAlign

      public VerticalAlign getVerticalAlign()

      Getter for the field verticalAlign.

      Returns:
      a VerticalAlign object.
      See Also:
    • setVerticalAlign

      public void setVerticalAlign(VerticalAlign verticalAlign)

      The vertical alignment of the legend box. Can be one of top, middle or bottom. Vertical position can be further determined by the y option.

      In the case that the legend is aligned in a corner position, the layout option will determine whether to place it above/below or on the side of the plot area.

      Defaults to: bottom

      Parameters:
      verticalAlign - a VerticalAlign object.
    • getWidth

      public Number getWidth()

      Getter for the field width.

      Returns:
      a Number object.
      See Also:
    • setWidth

      public void setWidth(Number width)
      The width of the legend box.
      Parameters:
      width - a Number object.
    • getX

      public Number getX()

      Getter for the field x.

      Returns:
      a Number object.
      See Also:
    • setX

      public void setX(Number x)
      The x offset of the legend relative to its horizontal alignment align within chart.spacingLeft and chart.spacingRight. Negative x moves it to the left, positive x moves it to the right.

      Defaults to: 0

      Parameters:
      x - a Number object.
    • getY

      public Number getY()

      Getter for the field y.

      Returns:
      a Number object.
      See Also:
    • setY

      public void setY(Number y)
      The vertical offset of the legend relative to it's vertical alignment verticalAlign within chart.spacingTop and chart.spacingBottom. Negative y moves it up, positive y moves it down.

      Defaults to: 0

      Parameters:
      y - a Number object.