Active
Project:
Visualization API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 May 2013 at 02:45 UTC
Updated:
9 May 2013 at 02:45 UTC
It would be really nice if you could customize the tooltips. Documentation
Some thoughts for a starting point:
Actually the data-Array is created by google.visualization.arrayToDataTable(chart.dataArray) which makes it impossible. So it will be necessary to loop through the data array and add a new row for each value instead. If custom tooltips are given then you need to add an additional column with role: 'tooltip'.
On PHP side the tooltips could be provided by an (optional) tooltip array within the $options passed to the theme function (and then passed to Drupal.settings).
Example for the $options array:
$options = array(
'title' => 'Sales',
'fields' => array(
'date' => array(
'label' => t('Date'),
),
'count' => array(
'enabled' => TRUE,
'label' => t('Sold products'),
),
),
'xAxis' => array(
'labelField' => 'date',
),
'type' => 'line',
'data' => array(
array(
'count' => 5,
'date' => 'January',
),
array(
'count' => 11,
'date' => 'February',
),
),
'tooltips' => array('5 sales in jan', '11 sales in feb'),
);