public class AbstractLegend<T extends AbstractLegend> extends AbstractChartObject implements HasMargins<AbstractLegend>
Constructor and Description |
---|
AbstractLegend() |
Modifier and Type | Method and Description |
---|---|
T |
addItems(LegendItem... items)
Adds items.
|
java.lang.String |
getAccessibleLabel() |
Align |
getAlign() |
java.lang.Boolean |
getAutoMargins() |
java.lang.Double |
getBackgroundAlpha() |
Color |
getBackgroundColor() |
java.lang.Double |
getBorderAlpha() |
Color |
getBorderColor() |
java.lang.Integer |
getBottom() |
Color |
getColor() |
java.lang.Boolean |
getCombineLegend() |
java.util.List<LegendItem> |
getData() |
java.lang.String |
getDivId() |
java.lang.Boolean |
getEnabled() |
java.lang.Boolean |
getEqualWidths() |
java.lang.Integer |
getFontSize() |
java.lang.Boolean |
getForceWidth() |
java.lang.Integer |
getGradientRotation() |
java.lang.Integer |
getHorizontalGap() |
java.lang.String |
getLabelText() |
java.lang.Integer |
getLabelWidth() |
java.lang.Integer |
getLeft() |
java.lang.Integer |
getMarginBottom() |
java.lang.Integer |
getMarginLeft() |
java.lang.Integer |
getMarginRight() |
java.lang.Integer |
getMarginTop() |
java.lang.Double |
getMarkerBorderAlpha() |
Color |
getMarkerBorderColor() |
java.lang.Integer |
getMarkerBorderThickness() |
Color |
getMarkerDisabledColor() |
java.lang.Integer |
getMarkerLabelGap() |
java.lang.Integer |
getMarkerSize() |
MarkerType |
getMarkerType() |
java.lang.Integer |
getMaxColumns() |
java.lang.String |
getPeriodValueText() |
LegendPosition |
getPosition() |
java.lang.Boolean |
getReversedOrder() |
java.lang.Integer |
getRight() |
Color |
getRollOverColor() |
java.lang.Double |
getRollOverGraphAlpha() |
java.lang.Boolean |
getShowEntries() |
java.lang.Integer |
getSpacing() |
java.lang.Boolean |
getSwitchable() |
Color |
getSwitchColor() |
LegendSwitch |
getSwitchType() |
java.lang.Integer |
getTabIndex() |
java.lang.Boolean |
getTextClickEnabled() |
java.lang.Integer |
getTop() |
java.lang.Boolean |
getUseGraphSettings() |
java.lang.Boolean |
getUseMarkerColorForLabels() |
java.lang.Boolean |
getUseMarkerColorForValues() |
ValueAlign |
getValueAlign() |
JsFunction |
getValueFunction() |
java.lang.String |
getValueText() |
java.lang.Integer |
getValueWidth() |
java.lang.Integer |
getVerticalGap() |
java.lang.Integer |
getWidth() |
T |
setAccessibleLabel(java.lang.String accessibleLabel)
Sets the text which screen readers will read if user rolls-over the element or sets focus on it using tab key
(this is possible only if tabIndex property is set to some number).
|
T |
setAlign(Align align)
Sets alignment of legend entries.
|
T |
setAutoMargins(java.lang.Boolean autoMargins)
Set autoMargins to true if you want margins of the legend should be adjusted and made equal to chart's margins.
|
T |
setBackgroundAlpha(java.lang.Double backgroundAlpha)
Sets opacity of legend's background.
|
T |
setBackgroundColor(Color backgroundColor)
Sets background color.
|
T |
setBorderAlpha(java.lang.Double borderAlpha)
Sets opacity of chart's border.
|
T |
setBorderColor(Color borderColor)
Sets color of legend's border.
|
T |
setBottom(java.lang.Integer bottom)
Sets distance from bottom of the chart, in pixels if legend position is set to "absolute".
|
T |
setColor(Color color)
Sets text color.
|
void |
setCombineLegend(java.lang.Boolean combineLegend)
Set combineLegend to true if you want to display both legend data and graph’s entries.
|
T |
setData(java.util.List<LegendItem> data)
Sets list of legend items.
|
T |
setDivId(java.lang.String divId)
Sets id of a div in case you want the legend to be placed in a separate container.
|
T |
setEnabled(java.lang.Boolean enabled)
Specifies if legend is enabled or not.
|
T |
setEqualWidths(java.lang.Boolean equalWidths)
Set equalWidths to false if each of legend entry shouldn't be equal to the most widest entry.
|
T |
setFontSize(java.lang.Integer fontSize)
Sets font size.
|
T |
setForceWidth(java.lang.Boolean forceWidth)
Set forceWidth to true if you want the width of legend item labels won't be adjusted.
|
T |
setGradientRotation(java.lang.Integer gradientRotation)
Sets gradient rotation of the legend.
|
T |
setHorizontalGap(java.lang.Integer horizontalGap)
Sets horizontal space between legend item and left/right border.
|
T |
setLabelText(java.lang.String labelText)
Sets the text which will be displayed in the legend.
|
T |
setLabelWidth(java.lang.Integer labelWidth)
Sets label width.
|
T |
setLeft(java.lang.Integer left)
Sets distance from left side of the chart, in pixels.
|
T |
setMarginBottom(java.lang.Integer marginBottom)
Sets bottom spacing.
|
T |
setMarginLeft(java.lang.Integer marginLeft)
Sets left-hand spacing.
|
T |
setMarginRight(java.lang.Integer marginRight)
Sets right-hand spacing.
|
T |
setMarginTop(java.lang.Integer marginTop)
Sets top spacing.
|
T |
setMarkerBorderAlpha(java.lang.Double markerBorderAlpha)
Sets marker border opacity.
|
T |
setMarkerBorderColor(Color markerBorderColor)
Sets marker border color.
|
T |
setMarkerBorderThickness(java.lang.Integer markerBorderThickness)
Sets thickness of the legend border.
|
T |
setMarkerDisabledColor(Color markerDisabledColor)
Sets the color of the disabled marker (when the graph is hidden).
|
T |
setMarkerLabelGap(java.lang.Integer markerLabelGap)
Sets space between legend marker and legend text, in pixels.
|
T |
setMarkerSize(java.lang.Integer markerSize)
Sets size of the legend marker (key).
|
T |
setMarkerType(MarkerType markerType)
Sets shape of the legend marker (key).
|
T |
setMaxColumns(java.lang.Integer maxColumns)
Sets maximum number of columns in the legend.
|
T |
setPeriodValueText(java.lang.String periodValueText)
Sets the text which will be displayed in the value portion of the legend when user is not hovering above any
data point.
|
T |
setPosition(LegendPosition position)
Sets position of a legend.
|
T |
setReversedOrder(java.lang.Boolean reversedOrder)
Set reversedOrder to true if legend entries should be placed in reversed order.
|
T |
setRight(java.lang.Integer right)
Sets distance from right side of the chart, in pixels if legend position is set to "absolute".
|
T |
setRollOverColor(Color rollOverColor)
Sets legend item text color on roll-over.
|
T |
setRollOverGraphAlpha(java.lang.Double rollOverGraphAlpha)
Sets the opacity of the non-hovered graphs.
|
T |
setShowEntries(java.lang.Boolean showEntries)
Set showEntries to false if you want to turn all the legend entries off.
|
T |
setSpacing(java.lang.Integer spacing)
Sets horizontal space between legend items, in pixels.
|
T |
setSwitchable(java.lang.Boolean switchable)
Set switchable to true if graphs should be shown/hidden by clicking on the legend marker.
|
T |
setSwitchColor(Color switchColor)
Sets legend switch color.
|
T |
setSwitchType(LegendSwitch switchType)
Sets legend switch type (in case the legend is switchable).
|
T |
setTabIndex(java.lang.Integer tabIndex)
Sets tab index to the legend.
|
T |
setTextClickEnabled(java.lang.Boolean textClickEnabled)
Set textClickEnabled to true if you want show/hide balloon of the graph by click on the text.
|
T |
setTop(java.lang.Integer top)
Sets distance from top of the chart, in pixels, if legend position is set to "absolute".
|
T |
setUseGraphSettings(java.lang.Boolean useGraphSettings)
Set useGraphSettings to true if you want to use graph’s settings.
|
T |
setUseMarkerColorForLabels(java.lang.Boolean useMarkerColorForLabels)
Set useMarkerColorForLabels to true if you want
labels should use marker color. |
T |
setUseMarkerColorForValues(java.lang.Boolean useMarkerColorForValues)
Set useMarkerColorForValues to true if legend values should use the same color as corresponding markers.
|
T |
setValueAlign(ValueAlign valueAlign)
Sets alignment of the value text.
|
T |
setValueFunction(JsFunction valueFunction)
Sets JS function to format value labels.
|
T |
setValueText(java.lang.String valueText)
Sets the text which will be displayed in the value portion of the legend.
|
T |
setValueWidth(java.lang.Integer valueWidth)
Sets width of the value text.
|
T |
setVerticalGap(java.lang.Integer verticalGap)
Sets vertical space between legend items also between legend border and first and last legend row.
|
T |
setWidth(java.lang.Integer width)
Sets width of a legend, when position is set to absolute.
|
public Align getAlign()
public T setAlign(Align align)
align
- alignpublic java.lang.Boolean getAutoMargins()
public T setAutoMargins(java.lang.Boolean autoMargins)
autoMargins
- autoMargins optionpublic java.lang.Double getBackgroundAlpha()
public T setBackgroundAlpha(java.lang.Double backgroundAlpha)
backgroundAlpha
- opacitypublic Color getBackgroundColor()
public T setBackgroundColor(Color backgroundColor)
backgroundColor
- background colorpublic java.lang.Double getBorderAlpha()
public T setBorderAlpha(java.lang.Double borderAlpha)
borderAlpha
- opacitypublic Color getBorderColor()
public T setBorderColor(Color borderColor)
borderColor
- border colorpublic java.lang.Integer getBottom()
public T setBottom(java.lang.Integer bottom)
bottom
- bottompublic Color getColor()
public T setColor(Color color)
color
- text colorpublic java.util.List<LegendItem> getData()
public T setData(java.util.List<LegendItem> data)
data
- list of legend itemspublic T addItems(LegendItem... items)
items
- itemspublic java.lang.Boolean getEqualWidths()
public T setEqualWidths(java.lang.Boolean equalWidths)
equalWidths
- equals widths optionpublic java.lang.Integer getFontSize()
public T setFontSize(java.lang.Integer fontSize)
fontSize
- font sizepublic java.lang.Integer getHorizontalGap()
public T setHorizontalGap(java.lang.Integer horizontalGap)
horizontalGap
- horizontal gappublic java.lang.String getLabelText()
public T setLabelText(java.lang.String labelText)
labelText
- label textpublic java.lang.Integer getLeft()
public T setLeft(java.lang.Integer left)
left
- distance from left side of the chart, in pixelspublic java.lang.Integer getMarginBottom()
getMarginBottom
in interface HasMargins<AbstractLegend>
public T setMarginBottom(java.lang.Integer marginBottom)
HasMargins
If is used for Legend
default value is 0.
If is used for RadarChartModelImpl
the default value is 0.
If is used for chart based on RectangularChartModelImpl
(GanttChart, SerialChart, XYChart) the default value is 20.
If is used for chart based on SlicedChartModelImpl
(FunnelChart, PieChart) the default value is 10.
If is used for PanelsSettings
the default value is 0.
setMarginBottom
in interface HasMargins<AbstractLegend>
marginBottom
- bottom spacingpublic java.lang.Integer getMarginLeft()
getMarginLeft
in interface HasMargins<AbstractLegend>
public T setMarginLeft(java.lang.Integer marginLeft)
HasMargins
marginLeft will be ignored if chart is SerialChart
or XYChartModelImpl
and autoMargins
is true.
If is used for Legend
the default value is 20.
If is used for RadarChartModelImpl
the default value is 0.
If is used for chart based on RectangularChartModelImpl
(GanttChart, SerialChart, XYChart) the default value is
20.
If is used for chart based on SlicedChartModelImpl
the default value is 0.
If is used for PanelsSettings
the default value is 0.
setMarginLeft
in interface HasMargins<AbstractLegend>
marginLeft
- left-hand spacingpublic java.lang.Integer getMarginRight()
getMarginRight
in interface HasMargins<AbstractLegend>
public T setMarginRight(java.lang.Integer marginRight)
HasMargins
marginRight will be ignored if chart is SerialChart
or XYChartModelImpl
and autoMargins
is true.
If is used for Legend
the default value is 20.
If is used for RadarChartModelImpl
the default value is 0.
If is used for chart based on RectangularChartModelImpl
(GanttChart, SerialChart, XYChart) the default value is
20.
If is used for chart based on SlicedChartModelImpl
(FunnelChart, PieChart) the default value is 0.
If is used for PanelsSettings
the default value is 0.
setMarginRight
in interface HasMargins<AbstractLegend>
marginRight
- right-hand spacingpublic java.lang.Integer getMarginTop()
getMarginTop
in interface HasMargins<AbstractLegend>
public T setMarginTop(java.lang.Integer marginTop)
HasMargins
If is used for Legend
the default value is 0.
If is used for RadarChartModelImpl
the default value is 0.
If is used for chart based on RectangularChartModelImpl
(GanttChart, SerialChart, XYChart) the default value is 20.
If is used for chart based on SlicedChartModelImpl
the default value is 10.
If is used for PanelsSettings
the default value is 0.
setMarginTop
in interface HasMargins<AbstractLegend>
marginTop
- top spacingpublic java.lang.Double getMarkerBorderAlpha()
public T setMarkerBorderAlpha(java.lang.Double markerBorderAlpha)
markerBorderAlpha
- marker border opacitypublic Color getMarkerBorderColor()
public T setMarkerBorderColor(Color markerBorderColor)
markerBorderColor
- marker border colorpublic java.lang.Integer getMarkerBorderThickness()
public T setMarkerBorderThickness(java.lang.Integer markerBorderThickness)
markerBorderThickness
- marker border thicknesspublic Color getMarkerDisabledColor()
public T setMarkerDisabledColor(Color markerDisabledColor)
markerDisabledColor
- marker disabled colorpublic java.lang.Integer getMarkerLabelGap()
public T setMarkerLabelGap(java.lang.Integer markerLabelGap)
markerLabelGap
- marker label gappublic java.lang.Integer getMarkerSize()
public T setMarkerSize(java.lang.Integer markerSize)
markerSize
- marker sizepublic MarkerType getMarkerType()
public T setMarkerType(MarkerType markerType)
markerType
- marker typepublic java.lang.Integer getMaxColumns()
public T setMaxColumns(java.lang.Integer maxColumns)
maxColumns
- maximum number of columnspublic java.lang.String getPeriodValueText()
public T setPeriodValueText(java.lang.String periodValueText)
periodValueText
- period value textpublic LegendPosition getPosition()
public T setPosition(LegendPosition position)
position
- positionpublic java.lang.Boolean getReversedOrder()
public T setReversedOrder(java.lang.Boolean reversedOrder)
reversedOrder
- reversed order optionpublic java.lang.Integer getRight()
public T setRight(java.lang.Integer right)
right
- distance from right side of the chart, in pixelspublic Color getRollOverColor()
public T setRollOverColor(Color rollOverColor)
rollOverColor
- roll over colorpublic java.lang.Double getRollOverGraphAlpha()
public T setRollOverGraphAlpha(java.lang.Double rollOverGraphAlpha)
rollOverGraphAlpha
- roll over graph alphapublic java.lang.Boolean getShowEntries()
public T setShowEntries(java.lang.Boolean showEntries)
showEntries
- showEntries optionpublic java.lang.Integer getSpacing()
public T setSpacing(java.lang.Integer spacing)
spacing
- horizontal space between legend items, in pixelspublic java.lang.Boolean getSwitchable()
public T setSwitchable(java.lang.Boolean switchable)
switchable
- switchable optionpublic Color getSwitchColor()
public T setSwitchColor(Color switchColor)
switchColor
- switch colorpublic LegendSwitch getSwitchType()
public T setSwitchType(LegendSwitch switchType)
switchType
- legend switch typepublic java.lang.Boolean getTextClickEnabled()
public T setTextClickEnabled(java.lang.Boolean textClickEnabled)
textClickEnabled
- textClickEnabledpublic java.lang.Integer getTop()
public T setTop(java.lang.Integer top)
top
- distance from top of the chart, in pixelspublic java.lang.Boolean getUseGraphSettings()
public T setUseGraphSettings(java.lang.Boolean useGraphSettings)
useGraphSettings
- use graph settings optionpublic java.lang.Boolean getUseMarkerColorForLabels()
labels
use marker colorpublic T setUseMarkerColorForLabels(java.lang.Boolean useMarkerColorForLabels)
labels
should use marker color. If not set the
default value is false.useMarkerColorForLabels
- useMarkerColorForLabels optionpublic java.lang.Boolean getUseMarkerColorForValues()
public T setUseMarkerColorForValues(java.lang.Boolean useMarkerColorForValues)
useMarkerColorForValues
- useMarkerColorForValues optionpublic ValueAlign getValueAlign()
public T setValueAlign(ValueAlign valueAlign)
valueAlign
- alignment of the value textpublic java.lang.String getValueText()
public T setValueText(java.lang.String valueText)
valueText
- value textpublic java.lang.Integer getValueWidth()
public T setValueWidth(java.lang.Integer valueWidth)
valueWidth
- value widthpublic java.lang.Integer getVerticalGap()
public T setVerticalGap(java.lang.Integer verticalGap)
verticalGap
- vertical spacepublic java.lang.String getDivId()
public T setDivId(java.lang.String divId)
divId
- id of a divpublic java.lang.Boolean getEnabled()
public T setEnabled(java.lang.Boolean enabled)
enabled
- enabled optionpublic java.lang.Integer getLabelWidth()
public T setLabelWidth(java.lang.Integer labelWidth)
labelWidth
- label widthpublic JsFunction getValueFunction()
public T setValueFunction(JsFunction valueFunction)
Cursor
added to the chart). This method should
return string which will be displayed as value in the legend.valueFunction
- JS functionpublic java.lang.Integer getWidth()
public T setWidth(java.lang.Integer width)
width
- width of a legendpublic java.lang.Boolean getForceWidth()
public T setForceWidth(java.lang.Boolean forceWidth)
forceWidth
- force width optionpublic java.lang.Integer getGradientRotation()
public T setGradientRotation(java.lang.Integer gradientRotation)
gradientRotation
- gradient rotation of the legendpublic java.lang.Integer getTabIndex()
public T setTabIndex(java.lang.Integer tabIndex)
tabIndex
- tab indexpublic java.lang.String getAccessibleLabel()
public T setAccessibleLabel(java.lang.String accessibleLabel)
accessibleLabel
- accessible label textpublic java.lang.Boolean getCombineLegend()
public void setCombineLegend(java.lang.Boolean combineLegend)
combineLegend
- combineLegend option