Class MapDataSeries

All Implemented Interfaces:
Series, Serializable

public class MapDataSeries extends AbstractSeries

MapDataSeries class.

Version:
$Id: $Id
Author:
Vaadin
See Also:
  • Constructor Details

    • MapDataSeries

      public MapDataSeries()
      Constructs an empty MapDataSeries. Developers should then populate the series with various addData and setData methods.
    • MapDataSeries

      public MapDataSeries(String name)
      Constructs a new MapDataSeries instance with the given name.
      Parameters:
      name - a String object.
    • MapDataSeries

      public MapDataSeries(List<MapDataSeriesItem> items)
      Constructs a new MapDataSeries instance with the given items.
      Parameters:
      items - items to be contained in the constructed MapDataSeries
    • MapDataSeries

      public MapDataSeries(MapDataSeriesItem... items)
      Constructs a new MapDataSeries with the given items.
      Parameters:
      items - items to be contained in the constructed MapDataSeries
  • Method Details

    • setData

      public void setData(String[] codes, Number[] values)
      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

      public void setData(String[] codes, Number[] values, Color[] colors)
      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

      public void setData(List<MapDataSeriesItem> data)
      Sets the data to the provided list of data items. If Map is already displayed redraw() to update the series in the UI
      Parameters:
      data - a List object.
    • get

      public MapDataSeriesItem get(String name)

      get.

      Parameters:
      name - The name of the data item to find.
      Returns:
      The first MapDataSeriesItem identified by the specified name. Returns null if no matching item is found.
    • add

      public void add(MapDataSeriesItem item)
      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

      public void addItemWithDrilldown(MapDataSeriesItem item, Series series)
      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 in Configuration.getDrilldown()
      Parameters:
      item - a MapDataSeriesItem object.
      series - a Series object.
    • addItemWithDrilldown

      public void addItemWithDrilldown(MapDataSeriesItem item)
      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 a Series when drilldown is done. The remaining drilldown configurations can be set in Configuration.getDrilldown()
      Parameters:
      item - a MapDataSeriesItem object.
    • add

      public void add(MapDataSeriesItem item, boolean updateMapImmediately, boolean shift)
      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

      public void remove(MapDataSeriesItem item)
      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

      public List<MapDataSeriesItem> getData()
      Return an unmodifiable list of the data items in this series.
      Returns:
      a List object.
    • update

      public void update(MapDataSeriesItem item)
      Triggers an update of the map for the specified data item.
      Parameters:
      item - The item to update.
    • get

      public MapDataSeriesItem get(int index)
      Returns MapDataSeriesItem at 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

      public void setJoinBy(String dataKey)
      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 - a String object.
    • setJoinBy

      public void setJoinBy(String mapDataKey, String dataKey)
      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:
      mapDataKey - a String object.
      dataKey - a String object.
    • getJoinBy

      public List<String> getJoinBy()

      Getter for the field joinBy.

      Returns:
      a List object.
    • resetJoinBy

      public void resetJoinBy()

      resetJoinBy.

    • setMapData

      public void setMapData(String mapData)

      Setter for the field mapData.

      Parameters:
      mapData - a String object.
    • getMapData

      public String getMapData()

      Getter for the field mapData.

      Returns:
      a String object.