Hi there, i've taken the bar chart example of dynamically showing the
data values as you hover over the data and tried to extend it to a
line chart but it doesnt appear to be fully working. Ive tried
debugging but i cannot seem to pin down the reason. Would anyone be
able to help me please?
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load('visualization', '1', {'packages':['linechart']});
google.setOnLoadCallback(drawChart);
var barsVisualization;
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'Price');
data.addRow([100]);
data.addRow([101]);
data.addRow([99]);
data.addRow([95]);
data.addRow([97]);
data.addRow([103]);
data.addRow([104]);
data.addRow([108]);
data.addRow([102]);
data.addRow([100]);
data.addRow([99]);
data.addRow([91]);
data.addRow([92]);
data.addRow([94]);
barsVisualization = new
google.visualization.LineChart(document.getElementById('chart_div')).draw(data,
{curveType: "function",width: 1500, height: 400,vAxis: {maxValue:
10}});
barsVisualization.draw(data, null);
google.visualization.events.addListener(barsVisualization,
'onmouseover', barMouseOver);
google.visualization.events.addListener(barsVisualization,
'onmouseout', barMouseOut);
}
function barMouseOver(e) {
barsVisualization.setSelection([e]);
}
function barMouseOut(e) {
barsVisualization.setSelection([{'row': null, 'column': null}]);
}
</script>
</head>
<body>
<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].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.