Package com.storedobject.chart
Class Legend
java.lang.Object
com.storedobject.chart.AbstractPart
com.storedobject.chart.VisiblePart
com.storedobject.chart.Legend
- All Implemented Interfaces:
Component,ComponentPart,ComponentProperty,HasPadding,HasPosition,VisibleProperty
Representation of legend. A legend will be automatically displayed by the
SOChart. However, that
can be turned off using SOChart.disableDefaultLegend() and customized legends may be added using
SOChart.add(Component...).- Author:
- Syam
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEncode the JSON string with the properties of this.final BordergetBorder(boolean create) Get the border.getPadding(boolean create) Get the padding of this on the chart display area.final PositiongetPosition(boolean create) Get the position of this on the chart display area.final TextStylegetTextStyle(boolean create) Get the text style.voidHide a chart.voidSet the border.voidsetPadding(Padding padding) Set the padding of this.final voidsetPosition(Position position) Set the position of this.voidsetTextStyle(TextStyle textStyle) Set the text style.voidMake a hidden chart visible again.voidDisplay it vertically.voidvalidate()This method is invoked bySOChartto check if the component or part is valid or not.Methods inherited from class com.storedobject.chart.VisiblePart
isVisible, setVisibleMethods inherited from class com.storedobject.chart.AbstractPart
equals, getId, getLabelTag, getName, getSerial, getZ, hashCode, hasId, setSerial, setZMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.chart.ComponentPart
className, getId, getName, getRenderingIndex, getSerial, setName, setRenderingIndex, setSerialMethods inherited from interface com.storedobject.chart.VisibleProperty
hide, show
-
Constructor Details
-
Legend
public Legend()
-
-
Method Details
-
encodeJSON
Description copied from interface:ComponentPropertyEncode the JSON string with the properties of this.- Specified by:
encodeJSONin interfaceComponentProperty- Overrides:
encodeJSONin classAbstractPart- Parameters:
sb- Encoded JSON string to be appended to this.
-
validate
public void validate()Description copied from interface:ComponentPartThis method is invoked bySOChartto check if the component or part is valid or not.- Specified by:
validatein interfaceComponentPart- Overrides:
validatein classVisiblePart
-
showVertically
public void showVertically()Display it vertically. -
getPosition
Description copied from interface:HasPositionGet the position of this on the chart display area. (Iftrueis passed as the parameter, a new position will be created if not already exists).- Specified by:
getPositionin interfaceHasPosition- Parameters:
create- Whether to create it or not.- Returns:
- Position.
-
setPosition
Description copied from interface:HasPositionSet the position of this.- Specified by:
setPositionin interfaceHasPosition- Parameters:
position- Position to set.
-
getTextStyle
Get the text style.- Parameters:
create- Whether to create if not exists or not.- Returns:
- Text style.
-
setTextStyle
Set the text style.- Parameters:
textStyle- Text style to set.
-
getPadding
Description copied from interface:HasPaddingGet the padding of this on the chart display area. (Iftrueis passed as the parameter, a new padding will be created if not already exists).- Specified by:
getPaddingin interfaceHasPadding- Parameters:
create- Whether to create it or not.- Returns:
- Padding.
-
setPadding
Description copied from interface:HasPaddingSet the padding of this.- Specified by:
setPaddingin interfaceHasPadding- Parameters:
padding- Padding to set.
-
getBorder
Get the border.- Parameters:
create- Whether to create if not exists or not.- Returns:
- Border.
-
setBorder
-
hide
Hide a chart. The chart can be made visible by clicking on the legend later.- Parameters:
chart- Chart to hide.
-
show
Make a hidden chart visible again.- Parameters:
chart- Chart to make visible.
-