Package org.zkoss.chart
Class Cluster
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Cluster
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class Cluster extends Optionable
Options for marker clusters, the concept of sampling the data values into larger blocks in order to ease readability and increase performance of the JavaScript charts.Note: marker clusters module is not working with boost and draggable-points modules.
All the options in this class support
DynamicalAttribute
.- Since:
- 10.2.1.0
- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Cluster()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Animation
getAnimation()
Returns whether to enable or disable for the cluster marker animation.DataLabels
getDataLabels()
Returns the cluster data labels.ClusterLayoutAlgorithm
getLayoutAlgorithm()
Options for layout algorithm.Marker
getMarker()
Returns the cluster marker.Number
getMinimumClusterSize()
The minimum amount of points to be combined into a cluster.States
getStates()
Returns a wrapper object for the cluster options in specific states.List<Zone>
getZones()
An list defining zones within marker clusters.boolean
isAllowOverlap()
Returns false to prevent cluster overlapping - this option works only whenlayoutAlgorithm.type
= "grid".boolean
isAnimation()
Returns whether to enable or disable for the cluster marker animation.boolean
isDrillToCluster()
Returns whether to zoom the plot area to the cluster points range when a cluster is clicked.boolean
isEnabled()
Returns whether to enable the marker-clusters module.void
setAllowOverlap(Boolean allowOverlap)
Sets to false prevent cluster overlapping - this option works only whenlayoutAlgorithm.type
= "grid".void
setAnimation(boolean animation)
Sets whether to enable or disable for the cluster marker animation.void
setAnimation(Animation animation)
Sets whether to enable or disable for the cluster marker animation.void
setDataLabels(DataLabels dataLabels)
Sets the cluster data labels.void
setDrillToCluster(boolean drillToCluster)
Sets whether to zoom the plot area to the cluster points range when a cluster is clicked.void
setEnabled(boolean enabled)
Sets whether to enable the marker-clusters module.void
setLayoutAlgorithm(ClusterLayoutAlgorithm layoutAlgorithm)
Options for layout algorithm.void
setMarker(Marker marker)
Sets the cluster markervoid
setMinimumClusterSize(Number minimumClusterSize)
The minimum amount of points to be combined into a cluster.void
setStates(States states)
Sets a wrapper object for the cluster options in specific states.void
setZones(List<Zone> zones)
Set the zones within marker clusters.void
setZones(Zone... zones)
Set the zones within marker clusters.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
isAllowOverlap
public boolean isAllowOverlap()
Returns false to prevent cluster overlapping - this option works only whenlayoutAlgorithm.type
= "grid".Default: true.
-
setAllowOverlap
public void setAllowOverlap(Boolean allowOverlap)
Sets to false prevent cluster overlapping - this option works only whenlayoutAlgorithm.type
= "grid".Default: true.
-
isAnimation
public boolean isAnimation()
Returns whether to enable or disable for the cluster marker animation.Default: true
-
getAnimation
public Animation getAnimation()
Returns whether to enable or disable for the cluster marker animation. The animation can also be set as aAnimation
object.Default:
{"duration": 500}
-
setAnimation
public void setAnimation(boolean animation)
Sets whether to enable or disable for the cluster marker animation.- See Also:
setAnimation(Animation)
,Animation
-
setAnimation
public void setAnimation(Animation animation)
Sets whether to enable or disable for the cluster marker animation. The animation can also be set as aAnimation
object.Default:
{"duration": 500}
- See Also:
setAnimation(boolean)
,Animation
-
getDataLabels
public DataLabels getDataLabels()
Returns the cluster data labels.Default: an instance of DataLabels.
-
setDataLabels
public void setDataLabels(DataLabels dataLabels)
Sets the cluster data labels.- See Also:
DataLabels
-
isDrillToCluster
public boolean isDrillToCluster()
Returns whether to zoom the plot area to the cluster points range when a cluster is clicked.Default: true.
-
setDrillToCluster
public void setDrillToCluster(boolean drillToCluster)
Sets whether to zoom the plot area to the cluster points range when a cluster is clicked.Default: true.
-
isEnabled
public boolean isEnabled()
Returns whether to enable the marker-clusters module.Default: false.
-
setEnabled
public void setEnabled(boolean enabled)
Sets whether to enable the marker-clusters module.Default: false.
-
getLayoutAlgorithm
public ClusterLayoutAlgorithm getLayoutAlgorithm()
Options for layout algorithm. Inside there are options to change the type of the algorithm, gridSize, distance or iterations.Default: an instance of ClusterLayoutAlgorithm
-
setLayoutAlgorithm
public void setLayoutAlgorithm(ClusterLayoutAlgorithm layoutAlgorithm)
Options for layout algorithm. Inside there are options to change the type of the algorithm, gridSize, distance or iterations.Default: null
-
getMarker
public Marker getMarker()
Returns the cluster marker.Default: an instance of Marker
-
setMarker
public void setMarker(Marker marker)
Sets the cluster marker
-
getMinimumClusterSize
public Number getMinimumClusterSize()
The minimum amount of points to be combined into a cluster. This value has to be greater or equal to 2.Defaults to 2.
-
setMinimumClusterSize
public void setMinimumClusterSize(Number minimumClusterSize)
The minimum amount of points to be combined into a cluster. This value has to be greater or equal to 2.Defaults to 2.
-
getStates
public States getStates()
Returns a wrapper object for the cluster options in specific states.Default: an instance of States
-
setStates
public void setStates(States states)
Sets a wrapper object for the cluster options in specific states.
-
getZones
public List<Zone> getZones()
An list defining zones within marker clusters.Default: null.
- See Also:
Zone
-
setZones
public void setZones(List<Zone> zones)
Set the zones within marker clusters.- See Also:
getZones()
,Zone
-
setZones
public void setZones(Zone... zones)
Set the zones within marker clusters.- See Also:
getZones()
,Zone
-
-