Hello everyone, I'm struggling with tooltips on my combo Chart, I hope you are able to help me with that.
Right now (in the code below) we have default tooltips. What I want to do is to add different customize (with html) tooltip to every part of column.
So e.g if mouse is on 2006/2007 Madagascar in tooltip you will get "<table><tr><td>Hello, we are in 2006/2007</td></tr><tr><td style="font-weight:bold">Madagascar !</td></tr></table>"
Can you show me how to add this properly to the code below?
Thank you in advance!
Cheers
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Average'],
['2004/05', 165, 938, 522, 998, 614.6],
['2005/06', 135, 1120, 599, 1268, 682],
['2006/07', 157, 1167, 587, 807, 623],
['2007/08', 139, 1110, 615, 968, 609.4],
['2008/09', 136, 691, 629, 1026, 569.6]
]);
// Create and draw the visualization.
var ac = new google.visualization.ComboChart(document.getElementById('visualization'));
var options = {
backgroundColor: 'none',
colors: ['#94D635', '#66AC00','#5A8120','#427000'],
height: 270,
width: 830,
areaOpacity: 1,
isStacked: true,
tooltip: { isHtml: true },
seriesType: "bars",
animation:{
duration: 1500,
easing: 'out'
},
vAxes: [{
minValue: 0,
min:0,
title: 'Revenue',
titleTextStyle: {color: '#666666'},
textStyle: { color: '#666'},
gridlines: {color: '#f5f5f5', count: 4},
baselineColor: '#bbb'
},{
minValue: 0,
min:0,
title: 'Number of transactions',
titleTextStyle: {color: '#666666'},
textStyle: { color: '#666'},
gridlines: {color: '#f5f5f5', count: 4},
baselineColor: '#bbb'
}],
hAxis: {
title: 'Month',
titleTextStyle: {color: '#666666'},
count: 1,
textStyle: { color: '#666666'}
},
series: {
0: {
targetAxisIndex: 0
},
1: {
targetAxisIndex: 0
},
2: {
targetAxisIndex: 0
},
3: {
targetAxisIndex: 0
},
4: {
type: "line",
color: "#333",
targetAxisIndex: 1
}
},
titlePosition: 'out',
axisTitlesPosition: 'out',
backgroundColor: {fill: "none"},
legend: {
textStyle: {color: '#666666'},
alignment: 'end',
position: 'top'
}
}
ac.draw(data, options);
}