You are here

public function VisualizationHandlerInterface::render in Visualization API 8

Renders a chart with a given HTML identifier, data set and options.

Parameters

$chart_id: A unique identifier associated with the chart. The HTML of the chart is also contained within a div with this identifier.

$data: An array of rows. Each row is an associative array with as key the internal field name.

$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 value

A string that will be the body of the chart div.

2 methods override VisualizationHandlerInterface::render()
GoogleVisualizationAPIHandler::render in src/Plugin/visualization/handler/GoogleVisualizationAPIHandler.php
Renders a chart using the Google Visualization API.
HighchartsHandler::render in src/Plugin/visualization/handler/HighchartsHandler.php
Renders a chart using Highcharts.

File

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

Class

VisualizationHandlerInterface
Provides interfaces used by the module and its plugins.

Namespace

Drupal\visualization

Code

public function render($chart_id, $data, $options);