When you draw a chart in a container div, all of the contents of the div
are overwritten, so chart_tip doesn't exist when you try to use it. Put
chart_tip outside chart_div and it should work fine.
As an aside, drawing charts in hidden divs can be problematic. There are
multiple ways around the issues, but generally I recommend unhiding the div
prior to drawing the chart and hiding it again in a "ready" event listener
for the chart, eg:
var tip = document.getElementById('chart_tip');
tip.style.display = 'block';
var chart = new google.visualization.ColumnChart(tip);
var runOnce = google.visualization.events.addListener(chart, 'ready',
function () {
tip.style.display = 'none';
google.visualization.events.removeListener(runOnce);
});
chart.draw(data, {
height: 400,
width: 600
});
On Friday, October 12, 2012 11:07:02 AM UTC-4, jiggi wrote:
>
>
> I am sorry. You are right. I would like to draw chart on chart_div and
> also chart_tip. I would like to hide the chart_tip and display it on mouse
> over. Why is that a problem? Kindly advise.
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/5oJXiutvdZUJ.
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.