Can anyone out there know how to show "Total" only when hover the chart?
Right now when point to the chart, it will show both date and total.. For
example, "Jan 1, 2017, Total:13" for first bar on column chart. I tried
the tooltip on below 3 ways but still failed.
Thanks in advance for all your helps.
function drawChart () {
var data = google.visualization.arrayToDataTable([
['Category', 'Name', 'Value'],
// ['Category', 'Name', {label: 'Value', role: 'tooltip'}],
[new Date(2017,0), 'A', 5],
[new Date(2017,0), 'B', 2],
[new Date(2017,0), 'C', 2],
[new Date(2017,0), 'D', 2],
[new Date(2017,0), 'E', 2],
[new Date(2017,1), 'A', 5],
[new Date(2017,1), 'B', 2],
[new Date(2017,1), 'C', 2],
[new Date(2017,1), 'D', 2],
[new Date(2017,1), 'E', 3],
[new Date(2017,2), 'A', 5],
[new Date(2017,2), 'B', 2],
[new Date(2017,2), 'C', 2],
[new Date(2017,2), 'D', 2],
[new Date(2017,2), 'E', 4],
[new Date(2017,3), 'A', 5],
[new Date(2017,3), 'B', 2],
[new Date(2017,3), 'C', 2],
[new Date(2017,3), 'D', 2],
[new Date(2017,3), 'E', 5],
[new Date(2017,4), 'A', 5],
[new Date(2017,4), 'B', 2],
[new Date(2017,4), 'C', 2],
[new Date(2017,4), D', 2],
[new Date(2017,4), 'E', 6],
[new Date(2017,5), 'A', 5],
[new Date(2017,5), 'B', 2],
[new Date(2017,5), 'C', 2],
[new Date(2017,5), 'D', 2],
[new Date(2017,5), 'E', 7],
]);
var aggregateData = google.visualization.data.group(data, [0], [{
// role: 'tooltip',
type: 'number',
label: 'Total',
column: 2,
aggregation: google.visualization.data.sum
}]);
// aggregateData.setColumnProperty(1, 'role', 'tooltip');
var chart = new
google.visualization.ColumnChart(document.querySelector('#chart'));
var options = {
height: 300,
width: 400,
legend: 'none'
};
chart.draw(aggregateData, options);
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/a8c3fa53-076c-4e6d-ac24-7ce66cc68d0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.