You are here

protected function Highcharts::buildCredits in Charts 8.3

Build credits.

Parameters

array $options: Options.

Return value

\Drupal\charts_highcharts\Settings\Highcharts\ChartCredits

1 call to Highcharts::buildCredits()
Highcharts::buildVariables in modules/charts_highcharts/src/Plugin/chart/Highcharts.php
Creates a JSON Object formatted for Highcharts JavaScript to use.

File

modules/charts_highcharts/src/Plugin/chart/Highcharts.php, line 429

Class

Highcharts
Defines a concrete class for a Highcharts.

Namespace

Drupal\charts_highcharts\Plugin\chart

Code

protected function buildCredits(array $options) {
  $chartCredits = new ChartCredits();
  if (isset($options['credits'])) {
    $chartCredits
      ->setEnabled(TRUE);
    $chartCredits
      ->setText($options['credits']);
    $position = new ChartCreditsPosition();
    $position
      ->setX(10);
    $position
      ->setY(-20);
    $chartCredits
      ->setPosition($position);
  }
  return $chartCredits;
}