Jump to content

JSChart not working for IE9..


njdubois

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.