You are here

protected function Chartjs::buildTitle in Charts 8.3

Parameters

$options:

Return value

\stdClass

1 call to Chartjs::buildTitle()
Chartjs::buildOptions in modules/charts_chartjs/src/Plugin/chart/Chartjs.php
Build the options.

File

modules/charts_chartjs/src/Plugin/chart/Chartjs.php, line 172

Class

Chartjs
Define a concrete class for a Chart.

Namespace

Drupal\charts_chartjs\Plugin\chart

Code

protected function buildTitle($options) {
  $title = new \stdClass();
  if (!empty($options['title_position']) && !empty($options['title'])) {
    $title->display = TRUE;
    $title->position = $options['title_position'];
    $title->text = $options['title'];
  }
  else {
    $title->display = FALSE;
  }
  return $title;
}