njdubois Posted March 25, 2012 Share Posted March 25, 2012 I have 2 charts on my website. Both using the example stuff JSCharts provides on its website. One graph works in IE9, the other completely freezes IE9. I can also surf their example graphs, and build my own using IE9 no problem, so it leads me to believe its something with that one graphs code thats causeing the problem! <head> <title>Report</title> <script type="text/javascript" src="/sources/jscharts.js"></script> </head> <div id="chart_container">Loading chart...</div> <script type="text/javascript"> var myData = new Array(<?php echo $graph_str; ?>; var myChart = new JSChart('chart_container', 'line'); myChart.setDataArray(myData); myChart.colorize(['#1A90A9','#3E90C9','#3E90C9','#3E90C9','#3E90C9','#3E90C9','#3E90C9']); myChart.setIntervalY(0, <?php echo $high_call+1; ?>; myChart.setAxisValuesNumberY(<?php echo $high_call+2; ?>; myChart.setAxisValuesDecimals(0) myChart.setSize(616, 321); myChart.setAxisNameColor'#FFFFFF'); myChart.setAxisNameColorY('#FFFFFF'); myChart.setGridColor('#000000'); myChart.setBackgroundImage('chart_bg.jpg'); myChart.setLineWidth(5); myChart.draw(); </script> $graph_str="['Wednesday', 6], ['Thursday', 0], ['Friday', 5], ['Saturday', 6], ['Sunday', 0], ['Monday', 2], ['Tuesday', 6]" $high_call=6 if I remove myChart.draw(); the site loads, no graph, but the site loads and all the numbers are pulled no problem. Putting it back in and the site locks down. Again, the other graphs work fine, its just something in that chunk of code?!?! Any suggestions would be met with extreme appreciation...so, just a warning! Thanks Nick Quote Link to comment https://forums.phpfreaks.com/topic/259662-jschart-not-working-for-ie9/ Share on other sites More sharing options...
haku Posted March 25, 2012 Share Posted March 25, 2012 You should consider a code editor with color highlighting - you may find it a little easier to debug these problems. You are missing closing brackets after each of your php calls. Quote Link to comment https://forums.phpfreaks.com/topic/259662-jschart-not-working-for-ie9/#findComment-1330930 Share on other sites More sharing options...
njdubois Posted March 25, 2012 Author Share Posted March 25, 2012 I posted the question on the JS Chart forum first. Used the code tags and all, and it turned anything that could be into an emotiocon. Didn't seem like I was going to get the kind of help I needed. But like an idiot, I cut and pasted the forum post. The end brackets are their. <script type="text/javascript"> var myData = new Array(<?php echo $graph_str; ?>); var myChart = new JSChart('chart_container', 'line'); myChart.setDataArray(myData); myChart.colorize(['#1A90A9','#3E90C9','#3E90C9','#3E90C9','#3E90C9','#3E90C9','#3E90C9']); myChart.setIntervalY(0, <?php echo $high_call+1; ?>); myChart.setAxisValuesNumberY(<?php echo $high_call+2; ?>); myChart.setAxisValuesDecimals(0) myChart.setSize(616, 321); myChart.setAxisNameColorX('#FFFFFF'); myChart.setAxisNameColorY('#FFFFFF'); myChart.setGridColor('#000000'); myChart.setBackgroundImage('chart_bg.jpg'); myChart.setLineWidth(5); myChart.draw(); </script> Thanksd for the reply! Nick Quote Link to comment https://forums.phpfreaks.com/topic/259662-jschart-not-working-for-ie9/#findComment-1330947 Share on other sites More sharing options...
haku Posted March 25, 2012 Share Posted March 25, 2012 If it's not the brackets, then I have nothing. I don't know this plugin you are using, so I can't say anything. I know you already went to the source for help and didn't get much, but that's the place you are most likely to get support. Try building your graph up from the bottom. Right now you have a whole lot of code filled with variables and PHP output etc. Instead, code a basic graph with hard-coded values until you get it working, then start adding complexity and inserting your own variables and seeing where it falls apart. That will help you figure out what is causing the problem, and make it easier to debug. Quote Link to comment https://forums.phpfreaks.com/topic/259662-jschart-not-working-for-ie9/#findComment-1330966 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.