You are here

function charts_default_settings in Charts 8

Same name and namespace in other branches
  1. 7.2 includes/charts.pages.inc \charts_default_settings()

Provides default options used by charts_settings_form().

3 calls to charts_default_settings()
ChartsPluginStyleChart::defineOptions in src/Plugin/views/style/ChartsPluginStyleChart.php
Set default options.
charts_default_settings_form in includes/charts.pages.inc
Menu callback; Configure the site-wide defaults for charts.
charts_settings_form in includes/charts.pages.inc
5 string references to 'charts_default_settings'
ChartsConfigForm::buildForm in src/Form/ChartsConfigForm.php
Form constructor.
ChartsConfigForm::submitForm in src/Form/ChartsConfigForm.php
ChartsPluginStyleChart::defineOptions in src/Plugin/views/style/ChartsPluginStyleChart.php
Set default options.
charts_default_settings_form in includes/charts.pages.inc
Menu callback; Configure the site-wide defaults for charts.
charts_default_settings_form_submit in includes/charts.pages.inc
Submit handler for charts_default_settings_form().

File

includes/charts.pages.inc, line 622
Menu callbacks for Charts module.

Code

function charts_default_settings() {
  $defaults = array();
  $defaults['type'] = 'pie';
  $defaults['library'] = NULL;
  $defaults['label_field'] = NULL;
  $defaults['data_fields'] = NULL;
  $defaults['field_colors'] = NULL;
  $defaults['title'] = '';
  $defaults['title_position'] = 'out';
  $defaults['data_labels'] = FALSE;
  $defaults['legend'] = TRUE;
  $defaults['legend_position'] = 'right';
  $defaults['colors'] = charts_default_colors();
  $defaults['background'] = '';
  $defaults['tooltips'] = TRUE;
  $defaults['tooltips_use_html'] = FALSE;
  $defaults['width'] = NULL;
  $defaults['height'] = NULL;
  $defaults['xaxis_title'] = '';
  $defaults['xaxis_labels_rotation'] = 0;
  $defaults['yaxis_title'] = '';
  $defaults['yaxis_min'] = '';
  $defaults['yaxis_max'] = '';
  $defaults['yaxis_prefix'] = '';
  $defaults['yaxis_suffix'] = '';
  $defaults['yaxis_decimal_count'] = '';
  $defaults['yaxis_labels_rotation'] = 0;
  \Drupal::moduleHandler()
    ->alter('charts_default_settings', $defaults);
  return $defaults;
}