我一直在Google图表游戏中玩谷歌图表:
我一直在玩的代码是这样的:
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Year', 'Austria'],
['2003', 1336060],
['2004', 1538156],
['2005', 1576579],
['2006', 1600652],
['2007', 1968113],
['2008', 1901067]
]);
// Create and draw the visualization.
new google.visualization.BarChart(document.getElementById('visualization')).
draw(data,
{title:"Yearly Coffee Consumption by Country",
width:600, height:400,
vAxis: {title: "Year"},
hAxis: {title: "Cups"}}
);
}
Run Code Online (Sandbox Code Playgroud)
这给了我一个很好的图表,看起来像这样:

我试图让这个图表符合我的网站的需要,为此,我需要在左边的链接到另一个页面.因此,例如,2003年将是用户可以单击ans的链接,因此2004年等.
我试着这样做:
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Year', 'Austria'],
['<a href="url">Link text</a>', 1336060],
['2004', …Run Code Online (Sandbox Code Playgroud)