You are here

protected function Highcharts::buildYaxisLabels in Charts 8.3

Build the y-axis labels.

Parameters

array $options: Options.

Return value

\Drupal\charts_highcharts\Settings\Highcharts\YaxisLabel

1 call to Highcharts::buildYaxisLabels()
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 248

Class

Highcharts
Defines a concrete class for a Highcharts.

Namespace

Drupal\charts_highcharts\Plugin\chart

Code

protected function buildYaxisLabels(array $options) {
  $yaxisLabels = new YaxisLabel();
  if (!empty($options['yaxis_suffix'])) {
    $yaxisLabels
      ->setYaxisLabelSuffix($options['yaxis_suffix']);
  }
  if (!empty($options['yaxis_prefix'])) {
    $yaxisLabels
      ->setYaxisLabelPrefix($options['yaxis_prefix']);
  }
  return $yaxisLabels;
}