Class ResultHighmap

Object
AbstractPortletDto
ResultHighchart
ResultHighmap
All Implemented Interfaces:
Serializable, Portlet, ComplexCalculationResult

public class ResultHighmap extends ResultHighchart
Holds a Highmaps map definition returned from a logic element.

Create an instance with api.buildHighmap(definition) and return it from a logic element. The definition is passed to the Highmaps library without validation. The map to render comes from the chart.map property of the definition. The series data sets the values of the map areas, and the joinBy property of the series tells Highmaps how to match each data point to an area of the map.

Example:


 def definition = [
         chart : [map: "custom/europe"],
         series: [
                 [
                         name  : "Revenue",
                         joinBy: "hc-key",
                         data  : [
                                 ["hc-key": "de", value: 120],
                                 ["hc-key": "fr", value: 95],
                                 ["hc-key": "cz", value: 40]
                         ]
                 ]
         ]
 ]

 return api.buildHighmap(definition)
 
Since:
3.5 - Salty Dog
See Also:
  • Constructor Details

    • ResultHighmap

      public ResultHighmap(Map<String,?> definition)
      Not intended for public use. Use api.buildHighmap() instead.
      Parameters:
      definition - The Highmaps definition, as a map of maps and arrays.
      See Also:
  • Method Details

    • addMap

      public ResultHighmap addMap(String... maps)
      The map renderer will try to download the appropriate map by peeking at chart.map value of the provided definition. This method allows to download any other JavaScript file available under the mapdata/ directory.
      Parameters:
      maps - one or more Highmaps compatible JavaScript map names, with the same form as would be used for the chart.map property of the map definition; i.e. including the path from mapdata/ and without the ".js" extension. e.g. "countries/us/us-all", "custom/world-robinson", "custom/europe"
      Returns:
      the ResultHighmap instance, for convenience
      See Also:
    • getMapsList

      public List<String> getMapsList()
      Not intended for public use, required for JSON serialization.
      Returns:
      The map names added with addMap(String...).
    • getResultType

      public String getResultType()
      Returns the result type of the map.
      Specified by:
      getResultType in interface ComplexCalculationResult
      Overrides:
      getResultType in class ResultHighchart
      Returns:
      Always "HIGHMAP".