JSChart : String Error

Posted by agrovers 
JSChart : String Error
April 17, 2009 04:40PM
Hi All,

I'm getting this Error once my page starts loading

JSChart: Name must be string and corespond to an Existing ID.

If any one has any idea, please help.

Thanks in advance

~AJ
Re: JSChart : String Error
April 21, 2009 12:32PM
When creating the JScharts instance you must assign the ID of the element that will be the container of the chart. For example here http://www.jscharts.com/how-to-use that ID is 'chartcontainer'.

Sabin

--------------------
JS Charts - Created by Smartketer LLC
Re: JSChart : String Error
May 04, 2009 06:33PM
I am getting the same error, even though the code I am using is copied directly from the instructions.
<html><head>
<script type="text/javascript" src="/js/jscharts.js"></script>
<script type="text/javascript">
	var myData = new Array(['unit', 20], ['unit two', 10], ['unit three', 30], ['other unit', 10], ['last unit', 30]);
	var myChart = new JSChart('chartcontainer', 'bar');
	myChart.setDataArray(myData);
	myChart.draw();
</script>
</head><body>
<div id="chartcontainer">This is just a replacement in case Javascript is not available or used for SEO purposes</div>
</body></html>
Re: JSChart : String Error
May 04, 2009 07:12PM
I have uncovered my own error. I suspose I jumped the gun when putting this together.
<html><head>
<script type="text/javascript" src="/js/jscharts.js"></script>
</head><body>
<div id="chartcontainer">This is just a replacement in case Javascript is not available or used for SEO purposes</div>
<script type="text/javascript">
	var myData = new Array(['unit', 20], ['unit two', 10], ['unit three', 30], ['other unit', 10], ['last unit', 30]);
	var myChart = new JSChart('chartcontainer', 'bar');
	myChart.setDataArray(myData);
	myChart.draw();
</script>
</body></html>

Sorry, you do not have permission to post/reply in this forum.