Class LegendSettings

java.lang.Object
io.jmix.charts.model.AbstractChartObject
io.jmix.charts.model.settings.LegendSettings
All Implemented Interfaces:
Serializable

public class LegendSettings extends AbstractChartObject
Common settings of legends. If there is no default value specified, default value of StockLegend class will be used.
See documentation for properties of LegendSettings JS object.
http://docs.amcharts.com/3/javascriptstockchart/LegendSettings
See Also:
  • Constructor Details

    • LegendSettings

      public LegendSettings()
  • Method Details

    • getAlign

      public Align getAlign()
      Returns:
      alignment of legend entries
    • setAlign

      Sets alignment of legend entries. Possible values are: "left", "right" and "center".
      Parameters:
      align - alignment of legend entries
      Returns:
      legend settings
    • getEqualWidths

      public Boolean getEqualWidths()
      Returns:
      true if each legend entry takes the same space as the longest legend entry
    • setEqualWidths

      @StudioProperty(defaultValue="false") public LegendSettings setEqualWidths(Boolean equalWidths)
      Set equalWidths to true if each legend entry should take up much space as the longest legend entry. If not set the default value is false.
      Parameters:
      equalWidths - equalWidths option
      Returns:
      legend settings
    • getHorizontalGap

      public Integer getHorizontalGap()
      Returns:
      horizontal space between legend item and left/right border
    • setHorizontalGap

      @StudioProperty public LegendSettings setHorizontalGap(Integer horizontalGap)
      Sets horizontal space between legend item and left/right border.
      Parameters:
      horizontalGap - horizontal gap
      Returns:
      legend settings
    • getLabelText

      public String getLabelText()
      Returns:
      label text
    • setLabelText

      @StudioProperty public LegendSettings setLabelText(String labelText)
      Sets the text which will be displayed in the legend. Tag [[title]] will be replaced with the title of the graph.
      Parameters:
      labelText - text
      Returns:
      legend settings
    • getMarginBottom

      public Integer getMarginBottom()
      Returns:
      space below the last row of the legend, in pixels
    • setMarginBottom

      @StudioProperty(defaultValue="0") public LegendSettings setMarginBottom(Integer marginBottom)
      Sets space below the last row of the legend, in pixels. If not set the default value is 0.
      Parameters:
      marginBottom - margin bottom
      Returns:
      legend settings
    • getMarginTop

      public Integer getMarginTop()
      Returns:
      space above the first row of the legend, in pixels
    • setMarginTop

      @StudioProperty(defaultValue="0") public LegendSettings setMarginTop(Integer marginTop)
      Sets space above the first row of the legend, in pixels. If not set the default value is 0.
      Parameters:
      marginTop - margin top
      Returns:
      legend settings
    • getMarkerBorderAlpha

      public Double getMarkerBorderAlpha()
      Returns:
      opacity of marker border
    • setMarkerBorderAlpha

      @StudioProperty @Max(1L) @Min(0L) public @Max(1L) @Min(0L) LegendSettings setMarkerBorderAlpha(Double markerBorderAlpha)
      Sets opacity of marker border.
      Parameters:
      markerBorderAlpha - opacity
      Returns:
      legend settings
    • getMarkerBorderColor

      public Color getMarkerBorderColor()
      Returns:
      marker border color
    • setMarkerBorderColor

      @StudioProperty(type=OPTIONS) public LegendSettings setMarkerBorderColor(Color markerBorderColor)
      Sets marker border color.
      Parameters:
      markerBorderColor - color
      Returns:
      legend settings
    • getMarkerBorderThickness

      public Integer getMarkerBorderThickness()
      Returns:
      thickness of the legend border
    • setMarkerBorderThickness

      @StudioProperty public LegendSettings setMarkerBorderThickness(Integer markerBorderThickness)
      Sets thickness of the legend border.
      Parameters:
      markerBorderThickness - thickness
      Returns:
      legend settings
    • getMarkerDisabledColor

      public Color getMarkerDisabledColor()
      Returns:
      color of the disabled marker
    • setMarkerDisabledColor

      @StudioProperty(type=OPTIONS) public LegendSettings setMarkerDisabledColor(Color markerDisabledColor)
      Sets color of the disabled marker (when the graph is hidden).
      Parameters:
      markerDisabledColor - color
      Returns:
      legend settings
    • getMarkerLabelGap

      public Integer getMarkerLabelGap()
      Returns:
      space between legend marker and legend text, in pixels
    • setMarkerLabelGap

      @StudioProperty public LegendSettings setMarkerLabelGap(Integer markerLabelGap)
      Sets space between legend marker and legend text, in pixels.
      Parameters:
      markerLabelGap - marker label gap
      Returns:
      legend settings
    • getMarkerSize

      public Integer getMarkerSize()
      Returns:
      size of the legend marker
    • setMarkerSize

      @StudioProperty public LegendSettings setMarkerSize(Integer markerSize)
      Sets size of the legend marker (key).
      Parameters:
      markerSize - marker size
      Returns:
      legend settings
    • getMarkerType

      public MarkerType getMarkerType()
      Returns:
      legend marker type
    • setMarkerType

      @StudioProperty(type=ENUMERATION) public LegendSettings setMarkerType(MarkerType markerType)
      Sets shape of the legend marker (key). Possible values are: square, circle, diamond, triangleUp, triangleDown, triangleLeft, triangleDown, bubble, none.
      Parameters:
      markerType - marker type
      Returns:
      legend settings
    • getReversedOrder

      public Boolean getReversedOrder()
      Returns:
      true if legend entries placed in reversed order
    • setReversedOrder

      @StudioProperty public LegendSettings setReversedOrder(Boolean reversedOrder)
      Set reversedOrder to true if legend entries should be placed in reversed order.
      Parameters:
      reversedOrder - reversedOrder option
      Returns:
      legend settings
    • getRollOverColor

      public Color getRollOverColor()
      Returns:
      legend item text color on roll-over
    • setRollOverColor

      @StudioProperty(type=OPTIONS) public LegendSettings setRollOverColor(Color rollOverColor)
      Sets legend item text color on roll-over.
      Parameters:
      rollOverColor - color
      Returns:
      legend settings
    • getRollOverGraphAlpha

      public Double getRollOverGraphAlpha()
      Returns:
      opacity of the graphs
    • setRollOverGraphAlpha

      @StudioProperty public LegendSettings setRollOverGraphAlpha(Double rollOverGraphAlpha)
      Sets the opacity of the graphs. When you roll-over the legend entry, all other graphs can reduce their opacity, so that the graph you rolled-over would be distinguished.
      Parameters:
      rollOverGraphAlpha - opacity
      Returns:
      legend settings
    • getSwitchable

      public Boolean getSwitchable()
      Returns:
      true if graphs are shown/hidden by click on the legend marker
    • setSwitchable

      @StudioProperty public LegendSettings setSwitchable(Boolean switchable)
      Set switchable to false if graphs shouldn't be shown/hidden by click on the legend marker.
      Parameters:
      switchable - switchable option
      Returns:
      legend settings
    • getSwitchColor

      public Color getSwitchColor()
      Returns:
      legend switch color
    • setSwitchColor

      @StudioProperty(type=OPTIONS) public LegendSettings setSwitchColor(Color switchColor)
      Sets legend switch color.
      Parameters:
      switchColor - color
      Returns:
      legend settings
    • getSwitchType

      public SwitchType getSwitchType()
      Returns:
      switch type
    • setSwitchType

      @StudioProperty(type=ENUMERATION) public LegendSettings setSwitchType(SwitchType switchType)
      Sets legend switch type (in case the legend is switchable). Possible values are: "x" and "v".
      Parameters:
      switchType - switch type
      Returns:
      legend settings
    • getTextClickEnabled

      public Boolean getTextClickEnabled()
      Returns:
      true if the legend text is clickable
    • setTextClickEnabled

      @StudioProperty(defaultValue="false") public LegendSettings setTextClickEnabled(Boolean textClickEnabled)
      Set textClickEnabled to true if the legend text should be clickable. Clicking on legend text can show/hide value balloons if they are enabled. If not set the default value is false.
      Parameters:
      textClickEnabled - textClickEnabled option
      Returns:
      legend settings
    • getUseMarkerColorForLabels

      public Boolean getUseMarkerColorForLabels()
      Returns:
      true if legend labels use the same color as corresponding markers
    • setUseMarkerColorForLabels

      @StudioProperty public LegendSettings setUseMarkerColorForLabels(Boolean useMarkerColorForLabels)
      Set useMarkerColorForLabels to true if legend labels should use the same color as corresponding markers.
      Parameters:
      useMarkerColorForLabels - useMarkerColorForLabels option
      Returns:
      legend settings
    • getValueTextComparing

      public String getValueTextComparing()
      Returns:
      value text comparing
    • setValueTextComparing

      @StudioProperty public LegendSettings setValueTextComparing(String valueTextComparing)
      Sets the text which will be displayed in the value portion of the legend when graph is comparable and at least one dataSet is selected for comparing. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]].
      Parameters:
      valueTextComparing - value text comparing
      Returns:
      legend settings
    • getValueTextRegular

      public String getValueTextRegular()
      Returns:
      value text regular
    • setValueTextRegular

      @StudioProperty public LegendSettings setValueTextRegular(String valueTextRegular)
      Sets the text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]].
      Parameters:
      valueTextRegular - value text regular
      Returns:
      legend settings
    • getValueWidth

      public Integer getValueWidth()
      Returns:
      width of the value text
    • setValueWidth

      @StudioProperty public LegendSettings setValueWidth(Integer valueWidth)
      Sets width of the value text. Increase this value if your values do not fit in the allocated space.
      Parameters:
      valueWidth - width
      Returns:
      legend settings
    • getVerticalGap

      public Integer getVerticalGap()
      Returns:
      vertical space between legend items, in pixels
    • setVerticalGap

      @StudioProperty public LegendSettings setVerticalGap(Integer verticalGap)
      Sets vertical space between legend items, in pixels.
      Parameters:
      verticalGap - vertical gap
      Returns:
      legend settings
    • getPosition

      public LegendSettingsPosition getPosition()
      Returns:
      position of legend in panels
    • setPosition

      Sets position of legend in panels. Possible values are: "bottom" and "top".
      Parameters:
      position - position
      Returns:
      legend settings