Class MapDataSeries
java.lang.Object
com.vaadin.componentfactory.maps.model.AbstractConfigurationObject
com.vaadin.componentfactory.maps.model.AbstractSeries
com.vaadin.componentfactory.maps.model.MapDataSeries
- All Implemented Interfaces:
Series,Serializable
MapDataSeries class.
- Version:
- $Id: $Id
- Author:
- Vaadin
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an emptyMapDataSeries.MapDataSeries(MapDataSeriesItem... items) Constructs a new MapDataSeries with the given items.MapDataSeries(String name) Constructs a new MapDataSeries instance with the given name.MapDataSeries(List<MapDataSeriesItem> items) Constructs a new MapDataSeries instance with the given items. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MapDataSeriesItem item) Adds a data item and immediately updates the map if it already has been drawn.voidadd(MapDataSeriesItem item, boolean updateMapImmediately, boolean shift) Adds a data item and immediately sends an update to the map if so specified.voidAdds a new item to the series data and enables drilldown for it.voidaddItemWithDrilldown(MapDataSeriesItem item, Series series) Adds a new item to the series data.voidclear()Removes all items from the series.get(int index) ReturnsMapDataSeriesItemat given indexget.getData()Return an unmodifiable list of the data items in this series.Getter for the fieldjoinBy.Getter for the fieldmapData.voidredraw()Redraw series with updated data and plotOptionsvoidremove(MapDataSeriesItem item) Removes a given item and immediately removes it from the map.voidresetJoinBy.voidSets the data entries, first clearing the old ones.voidSets the data entries, first clearing the old ones.voidsetData(List<MapDataSeriesItem> data) Sets the data to the provided list of data items.voidWhat property to join the mapData to the value data.voidWhat property to join the mapData to the value data.voidsetMapData(String mapData) Setter for the fieldmapData.intsize()size.voidupdate(MapDataSeriesItem item) Triggers an update of the map for the specified data item.Methods inherited from class com.vaadin.componentfactory.maps.model.AbstractSeries
getConfiguration, getId, getName, getPlotOptions, getxAxis, getyAxis, isVisible, setConfiguration, setId, setName, setPlotOptions, setVisible, setVisible, setxAxis, setyAxis, setyAxis, updateSeries
-
Constructor Details
-
MapDataSeries
public MapDataSeries()Constructs an emptyMapDataSeries. Developers should then populate the series with various addData and setData methods. -
MapDataSeries
Constructs a new MapDataSeries instance with the given name.- Parameters:
name- aStringobject.
-
MapDataSeries
Constructs a new MapDataSeries instance with the given items.- Parameters:
items- items to be contained in the constructed MapDataSeries
-
MapDataSeries
Constructs a new MapDataSeries with the given items.- Parameters:
items- items to be contained in the constructed MapDataSeries
-
-
Method Details
-
setData
Sets the data entries, first clearing the old ones. Uses the given codes and numeric values. The codes and values arrays must be of equal length.- Parameters:
codes- An array of the category names.values- An array of the values for each category in the categoryNames parameter.
-
setData
Sets the data entries, first clearing the old ones. Uses the given codes, numeric values, and colors. The codes, values and colors arrays must be of equal length.- Parameters:
codes- An array of the code.values- An array of the values for each category in the categoryNames parameter.colors- An array of colors for each category name, value pair.
-
setData
Sets the data to the provided list of data items. If Map is already displayedredraw()to update the series in the UI- Parameters:
data- aListobject.
-
get
get.
- Parameters:
name- The name of the data item to find.- Returns:
- The first
MapDataSeriesItemidentified by the specified name. Returns null if no matching item is found.
-
add
Adds a data item and immediately updates the map if it already has been drawn. If the map has not yet been drawn, all items added will be added to the map when the map is drawn.remove(- Parameters:
item- the data item to be added- See Also:
-
addItemWithDrilldown
Adds a new item to the series data. And sets the series as its drilldown. Used for eager loading drilldown. Series must have an id. The remaining drilldown configurations can be set inConfiguration.getDrilldown()- Parameters:
item- aMapDataSeriesItemobject.series- aSeriesobject.
-
addItemWithDrilldown
Adds a new item to the series data and enables drilldown for it. Used for lazy loading drilldown. Using async drilldown requires setting to return aSerieswhen drilldown is done. The remaining drilldown configurations can be set inConfiguration.getDrilldown()- Parameters:
item- aMapDataSeriesItemobject.
-
add
Adds a data item and immediately sends an update to the map if so specified. Immediately updating the map causes it to dynamically add the data point.This method is useful if you want to add many items without a client/server round-trip for each item added. Do this by setting the updateMapImmediately parameter to false.
- Parameters:
item- The item to add.updateMapImmediately- Updates the map immediately if true.shift- If true, the first item from the series is removed. Handy if dynamically adjusting adding points and fixed amount of points should be kept visible.
-
remove
Removes a given item and immediately removes it from the map.- Parameters:
item- The item to remove.
-
redraw
public void redraw()Redraw series with updated data and plotOptions -
getData
Return an unmodifiable list of the data items in this series.- Returns:
- a
Listobject.
-
update
Triggers an update of the map for the specified data item.- Parameters:
item- The item to update.
-
get
ReturnsMapDataSeriesItemat given index- Parameters:
index- a int.- Returns:
- the Item
- Throws:
IndexOutOfBoundsException- if data series don't have item at given index
-
size
public int size()size.
- Returns:
- the number of data items in the series
-
clear
public void clear()Removes all items from the series. -
setJoinBy
What property to join the mapData to the value data. For example, if joinBy is "code", the mapData items with a specific code is merged into the data with the same code. For maps loaded from GeoJSON, the keys may be held in each point's properties object. The joinBy option can also be an array of two values, where the first points to a key in the mapData, and the second points to another key in the data.- Parameters:
dataKey- aStringobject.
-
setJoinBy
What property to join the mapData to the value data. For example, if joinBy is "code", the mapData items with a specific code is merged into the data with the same code. For maps loaded from GeoJSON, the keys may be held in each point's properties object. The joinBy option can also be an array of two values, where the first points to a key in the mapData, and the second points to another key in the data. -
getJoinBy
Getter for the field
joinBy.- Returns:
- a
Listobject.
-
resetJoinBy
public void resetJoinBy()resetJoinBy.
-
setMapData
Setter for the field
mapData.- Parameters:
mapData- aStringobject.
-
getMapData
Getter for the field
mapData.- Returns:
- a
Stringobject.
-