You are here

function charts_google_create_charts_options in Charts 8

Parameters

$options:

array $seriesData:

Return value

GoogleOptions object with chart options or settings to be used by google visualization framework

1 call to charts_google_create_charts_options()
template_preprocess_views_view_charts in ./charts.module

File

modules/charts_google/charts_google.module, line 67
Charts module integration with Google Charts library.

Code

function charts_google_create_charts_options($options, $seriesData = array()) {
  $googleOptions = new GoogleOptions();
  $googleOptions
    ->setTitle($options['title']);
  $chartArea = new ChartArea();
  $chartArea
    ->setWidth(400);

  // $googleOptions->setChartArea($chartArea);
  $seriesColors = array();
  for ($i = 0; $i < count($seriesData); $i++) {
    $seriesColor = $seriesData[$i]['color'];
    array_push($seriesColors, $seriesColor);
  }
  $googleOptions
    ->setColors($seriesColors);
  return $googleOptions;
}