You are here

protected function ScatterField::defineOptions in Charts 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Plugin/views/field/ScatterField.php \Drupal\charts\Plugin\views\field\ScatterField::defineOptions()
  2. 8.3 src/Plugin/views/field/ScatterField.php \Drupal\charts\Plugin\views\field\ScatterField::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides FieldPluginBase::defineOptions

File

src/Plugin/views/field/ScatterField.php, line 32
Defines Drupal\charts\Plugin\views\field\ScatterField.

Class

ScatterField
Field handler to provide x and y values for a scatter plot.

Namespace

Drupal\charts\Plugin\views\field

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $this->field_alias = 'scatter_field';
  $options['fieldset_one']['default'] = NULL;
  $options['fieldset_two']['default'] = NULL;
  $options['fieldset_one']['x_axis'] = [
    'default' => NULL,
  ];
  $options['fieldset_two']['y_axis'] = [
    'default' => NULL,
  ];
  return $options;
}