First this is a nice example of using a line chart. As for the IE issue then you are having a race condition between the chart events. If you remove the mouse onmouseover onmouseout handler the 'select' event will trigger a redirection when you click on a point.
HTH ChartMan On Tue, Dec 22, 2009 at 7:39 PM, SC <[email protected]> wrote: > I seem to have a problem running this line chart on Internet Explorer > 7. The way the code is setup is to hover over points to see the pop > up tooltip, and when clicked, go to a URL (in this case, www.google.com). > It seems to work fine in Firefox, Safari, and Chrome but in Internet > Explorer, the clicking of the point to go to the URL doesn't work. > You can see the highlighting of the point in the other browsers, but > not in IE. > > I wasn't sure if I needed to post this to issues, but I wanted to make > sure I wasn't doing something wrong in javascript that would clear up > the problem across all browsers. > > Thanks in advance... > > Here is the sample code: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> > <head> > <title>Chart Test</title> > </head> > <body> > > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > google.load("visualization", "1", {packages:["linechart"]}); > google.setOnLoadCallback(drawChart); > function drawChart() { > var jsonResults = {"rows":[{"c":[{"v":"Nov 07"},{"p": > {"url":"http://www.google.com"},"v":0.93,"f":"93.0%"},{"p": > {"url":"http://www.google.com"},"v":0.9378,"f":"93.8%"},{"p": > {"url":"http://www.google.com"},"v":0.9657,"f":"96.6%"}]},{"c": > [{"v":"Dec 07"},{"p":{"url":"http://www.google.com"},"v": > 0.93,"f":"93.0%"},{"p":{"url":"http://www.google.com"},"v": > 0.9728,"f":"97.3%"},{"p":{"url":"http://www.google.com"},"v": > 0.9482,"f":"94.8%"}]},{"c":[{"v":"Jan 08"},{"p":{"url":"http:// > www.google.com"},"v":0.93,"f":"93.0%"},{"p":{"url":"http://www.google.com > "},"v":0.9545,"f":"95.4%"},{"p":{"url":"http://www.google.com > "},"v":0.9736,"f":"97.4%"}]}],"cols":[{"type":"string","label":"Month","id":"month"},{"type":"number","label":"Target","id":"target"},{"type":"number","label":"First > Inc","id":"firstInc"},{"type":"number","label":"Second > Inc","id":"secondInc"}]}; > > var data = new google.visualization.DataTable(jsonResults, 0.6); > > var chartData = new google.visualization.LineChart > (document.getElementById('chart_div')); > chartData.draw(data, {width: 350, height: 250, tooltipWidth: 130, > legend: 'bottom', titleY: 'Percentile'}); > > // event handling > google.visualization.events.addListener(chartData, 'select', > function(e) { > var aSelection = chartData.getSelection(); > window.location.href=data.getProperties(aSelection[0].row, > aSelection[0].column).url; > }); > > google.visualization.events.addListener(chartData, 'onmouseover', > function(e) { > chartData.setSelection([e]); > }); > > google.visualization.events.addListener(chartData, 'onmouseout', > function(e) { > chartData.setSelection([{'row': null, 'column': null}]); > }); > } > </script> > > <div id='chart_div'></div> > </body></html> > > -- > > 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]<google-visualization-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > > > -- 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.
