Placement of your code is very important, if you look at your code you'll notice you've declared your
ChartVis
and
OnError
functions
inside the
$.ajax()
method. You need to move those two method declarations somewhere else. You should probably move them above the
$(document).ready()
line. Similar to:
<script type="text/javascript">
function ChartVis(..) {
..
}
function OnError(..) {
..
}
$(document).ready(function() {
..
});
</script>