You are here

function _charts_highcharts_type in Charts 8

Same name and namespace in other branches
  1. 7.2 modules/charts_highcharts/charts_highcharts.inc \_charts_highcharts_type()

Utility to convert a Drupal renderable type to a Google visualization type.

Parameters

$renderable_type:

Return value

bool|mixed

File

modules/charts_highcharts/charts_highcharts.inc, line 62
Callbacks and utility functions for rendering a Highcharts Chart.

Code

function _charts_highcharts_type($renderable_type) {
  $types = array(
    'area_chart' => 'AreaChart',
    'bar_chart' => 'BarChart',
    'column_chart' => 'ColumnChart',
    'line_chart' => 'LineChart',
    'pie_chart' => 'PieChart',
    'scatter_chart' => 'ScatterChart',
  );
  Drupal::moduleHandler()
    ->alter('charts_highcharts_types', $types);
  return isset($types[$renderable_type]) ? $types[$renderable_type] : FALSE;
}