Skip to content
Snippets Groups Projects
Commit 5853af2a authored by Pierre Vriens's avatar Pierre Vriens
Browse files

#2353511-12 Add 'tooltips' and 'data_labels' to Views UI

parent 0aaab0c2
No related branches found
No related tags found
No related merge requests found
...@@ -129,6 +129,30 @@ function charts_settings_form($form, $defaults = array(), $field_options = array ...@@ -129,6 +129,30 @@ function charts_settings_form($form, $defaults = array(), $field_options = array
'#parents' => array_merge($parents, array('title_position')), '#parents' => array_merge($parents, array('title_position')),
); );
$form['display']['tooltips'] = array(
'#title' => t('Tooltips'),
'#type' => 'select',
'#options' => array(
'' => t('Disabled'),
'TRUE' => t('Enabled'),
),
'#description' => t('Show data details on mouse over? Note: unavailable for print or on mobile devices.'),
'#default_value' => $options['tooltips'],
'#parents' => array_merge($parents, array('tooltips')),
);
$form['display']['data_labels'] = array(
'#title' => t('Data labels'),
'#type' => 'select',
'#options' => array(
'' => t('Disabled'),
'TRUE' => t('Enabled'),
),
'#default_value' => $options['data_labels'],
'#description' => t('Show data details as labels on chart? Note: recommended for print or on mobile devices.'),
'#parents' => array_merge($parents, array('data_labels')),
);
$form['display']['legend_position'] = array( $form['display']['legend_position'] = array(
'#title' => t('Legend position'), '#title' => t('Legend position'),
'#type' => 'select', '#type' => 'select',
...@@ -361,6 +385,7 @@ function charts_default_settings() { ...@@ -361,6 +385,7 @@ function charts_default_settings() {
$defaults['field_colors'] = NULL; $defaults['field_colors'] = NULL;
$defaults['title'] = ''; $defaults['title'] = '';
$defaults['title_position'] = 'out'; $defaults['title_position'] = 'out';
$defaults['data_labels'] = FALSE;
$defaults['legend'] = TRUE; $defaults['legend'] = TRUE;
$defaults['legend_position'] = 'right'; $defaults['legend_position'] = 'right';
$defaults['colors'] = charts_default_colors(); $defaults['colors'] = charts_default_colors();
......
...@@ -165,6 +165,8 @@ class charts_plugin_style_chart extends views_plugin_style { ...@@ -165,6 +165,8 @@ class charts_plugin_style_chart extends views_plugin_style {
'#id' => drupal_clean_css_identifier('chart_' . $chart_id), '#id' => drupal_clean_css_identifier('chart_' . $chart_id),
'#title' => $this->options['title_position'] ? $this->options['title'] : FALSE, '#title' => $this->options['title_position'] ? $this->options['title'] : FALSE,
'#title_position' => $this->options['title_position'], '#title_position' => $this->options['title_position'],
'#tooltips' => $this->options['tooltips'],
'#data_labels' => $this->options['data_labels'],
'#colors' => $this->options['colors'], '#colors' => $this->options['colors'],
'#background' => $this->options['background'] ? $this->options['background'] : 'transparent', '#background' => $this->options['background'] ? $this->options['background'] : 'transparent',
'#legend' => $this->options['legend_position'] ? TRUE : FALSE, '#legend' => $this->options['legend_position'] ? TRUE : FALSE,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment