Home
> Discussions & Support
> Topic
JSChart : String Error
Posted by agrovers
JSChart : String Error April 17, 2009 04:40PM |
Registered: 15 years ago Posts: 1 |
Re: JSChart : String Error April 21, 2009 12:32PM |
Registered: 15 years ago Posts: 117 |
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
Sabin
--------------------
JS Charts - Created by Smartketer LLC
Re: JSChart : String Error May 04, 2009 06:33PM |
Registered: 15 years ago Posts: 2 |
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 |
Registered: 15 years ago Posts: 2 |
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.