This is a kind of pseudo code, as I assume that you already have a chart.jsp page ready to go. I did my tests in PHP and it worked fine. I also use QTip2 .
This is your chart.jsp page:
<script type="text/javascript" src="http://www.google.com/jsapi"></script> int foo = Integer.parseInt(request.getParameter("foo")); switch(foo) { case 1: print <script> google.load('visualization', '1', {packages:['corechart']}); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Year', 'Sales', 'Expenses'], ['2004', 1000, 400], ['2005', 1170, 460], ['2006', 660, 1120], ['2007', 1030, 540] ]); var options = { title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }; var chart = new google.visualization.ColumnChart(document.getElementById('visualization')); chart.draw(data, options); } google.setOnLoadCallback(drawChart); </script> break; ... } <div id="visualization"></div>
On the other hand, where you call chart.jsp inside the tooltip via an iframe:
<script> $(function() { $('.tip').qtip({ content: function(){ var rel = $(this).attr('rel'); return $('<iframe id="tip" frameBorder="0" src="chart.jsp?foo='+ rel +'" />') }, hide: 'unfocus, click' }); }); </script> <a class="tip" href="javascript:void(0)" rel="1">Hover</a>
source share