Hi all,
I am trying to figure out how to make any click on a chart load a URL.
Just one URL for the entire chart, not different for each data point
as I see others have done.
I have a page with multiple tiny line charts with no details
displayed. Got this part working great. But I do need to make each
chart a clickable link to anther page where I will display a large
version of it with all the details.
I just have not had any luck finding an example of this on the site,
nor these forums.
My chart is generated with :
---------------
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Day');
data.addColumn('number', 'Orders');
data.addRows(2);
data.setValue(0, 0, '');
data.setValue(0, 1, 5);
data.setValue(1, 0, '');
data.setValue(1, 1, 10);
var chart1 = new
google.visualization.LineChart(document.getElementById('chart_div1'));
chart1.draw(data, {width: 100, height: 20, legend: 'none',
fontSize: 0, chartArea: {width: 100, height: 20}, gridlineColor:
'#EFEFEF', backgroundColor: '#EFEFEF'});
}
---------------
And I have tried various ways to make the entire chart a link to
another URL.
I think that I need to so something like:
-------------
google.visualization.events.addListener(_dataTable, 'select',
mouseClickHandler);
function mouseClickHandler()
{
location.href = ('https://www.website.com/page.php?variable=1');
}
------------
But no luck.
Anyone have a good example I can check out?
Thanks!
Steve
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.