Not ablel to display the charts

Posted by user538196 
Not ablel to display the charts
January 06, 2011 05:21AM
Hi,

Im using js chats to display charts in my jsp page. i have followed the instructions given in how to use page. But im getting the error saying

"JSChart: Name must be string and currespond to an existing ID" when i try to run the page.


im pasting the code here...
please help asap.


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[www.w3.org];
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JS Charts</title>
<script type="text/javascript" src="js_charts/jscharts.js"></script>
<script type="text/javascript">
var myData = new Array([10, 20], [15, 10], [20, 30], [25, 10], [30, 5]);
var myChart = new JSChart("divChart", "line"winking smiley;
myChart.setDataArray(myData);
myChart.draw();
</script>
</head>
<body>
<div id="divChart">This is just a replacement in case Javascript is not available or used for SEO purposes</div>
</body>
</html>


Thanks in advance.

Regards.
Re: Not ablel to display the charts
January 06, 2011 09:23AM
you can do this:

function initValue(){
......
}
document.addEventListener('DOMContentLoaded',initValue,false);

or

<div id="divChart">......</div>
<script type="text/javascript">
......
</script>
Sorry, you do not have permission to post/reply in this forum.