You are here

interface VisualizationHandlerInterface in Visualization API 8

Provides interfaces used by the module and its plugins.

Hierarchy

Expanded class hierarchy of VisualizationHandlerInterface

All classes that implement VisualizationHandlerInterface

2 files declare their use of VisualizationHandlerInterface
GoogleVisualizationAPIHandler.php in src/Plugin/visualization/handler/GoogleVisualizationAPIHandler.php
Drupal\visualization\Plugin\visualization\handler\GoogleVisualizationAPIHandler.
HighchartsHandler.php in src/Plugin/visualization/handler/HighchartsHandler.php
Drupal\visualization\Plugin\visualization\handler\HighchartsHandler.

File

src/VisualizationHandlerInterface.php, line 12
Definition of Drupal\visualization\VisualizationHandlerInterface.

Namespace

Drupal\visualization
View source
interface VisualizationHandlerInterface {

  /**
   * Renders a chart with a given HTML identifier, data set and options.
   *
   * @param $chart_id
   *	 A unique identifier associated with the chart. The HTML of the chart is
   *   also contained within a div with this identifier.
   *
   * @param $data
   *	 An array of rows. Each row is an associative array with as key the
   *   internal field name.
   *
   * @param $options
   *	 An associative array that contains options to be used when rendering,
   *   users can pass additional options for specific charting library
   *   implementations.
   *
   *	 Some default information is:
   *	  - title: the label of the chart
   *		- type: the internal name of the type of the chart; default types are
   *      	line, pie and column. Specific charting libraries are welcome to
   *				implement custom chart types as they please.
   *	 	- fields: an associative array of internal field names and their labels.
   *		- xAxis: options concerning the x-axis (if appropriate)
   *		- yAxis: options concerning the y-axis (if appropriate)
   *
   * @return
   *	 A string that will be the body of the chart div.
   */
  public function render($chart_id, $data, $options);

  /**
   * Performs anything that should be considered after rendering.
   */
  public function postRender();

  /**
   * Whether or not the handler is available for rendering.
   */
  public function available();

  /**
   * Returns an array containing the chart types supported by this handler.
   */
  public function supportedTypes();

}

Members

Namesort descending Modifiers Type Description Overrides
VisualizationHandlerInterface::available public function Whether or not the handler is available for rendering. 2
VisualizationHandlerInterface::postRender public function Performs anything that should be considered after rendering. 2
VisualizationHandlerInterface::render public function Renders a chart with a given HTML identifier, data set and options. 2
VisualizationHandlerInterface::supportedTypes public function Returns an array containing the chart types supported by this handler. 2