Skip to content

classes_lib_controls_datamap.class

Daniel Spors edited this page Dec 19, 2023 · 3 revisions

Classes in file lib/controls/datamap.class.php

class Datamap

Datamap wrapper for https://github.com/markmarkoh/datamaps

Extends: Control » Renderable

conf

Get/Set configuration.

Definition: public function conf($name, $value=null)

Returns: mixed If value is given, return $this, else returns the data for 'key'

Parameters:

  • string $name config key

  • mixed $value Optional value

PreRender

OVERRIDE Control::PreRender

setColor

Sets the color for a country.

Definition: public function setColor($country_code, $color, $tooltip=false)

Returns: static

Parameters:

  • string $country_code Country code (US, DE,...)

  • string $color HTML color

  • string $tooltip Optional tooltip

setColorRange

Sets a color range for the datamap.

Definition: public function setColorRange($range)

Returns: static

Parameters:

  • \ScavixWDF\Base\Color\ColorRange $range The ColorRange

setValue

Sets the value for a country. Note: This can only be used if a color range has been set with Datamap::setColorRange

Definition: public function setValue($country_code, $value, $tooltip=false)

Returns: static

Parameters:

  • string $country_code Country Code

  • float|int $value The value, see ColorRange::fromValue

  • string $tooltip Optional tooltip

Clone this wiki locally