after deployment of chart apI ver 7.0 on (Dec 7, 2011) line and combo charts stopped working.

18 views
Skip to first unread message

bolshoi medvedev

unread,
Dec 13, 2011, 1:16:23 PM12/13/11
to Google Visualization API
I've been using goole charts for several months now and have had no
issues...after the recent deployment on December 7, 2011 my line and
combo charts are returning an error of " 'count' is null or not an
object ". I can not find any documentation as to what this is
referencing. Following is my link to a pop up window to display my
chart and after that is the chart code.
I'm using the 1 asp page with the generic chart code in it and passin
multiple variables through the URL. Sometimes it has 7 horizontal
columns if it is displaying days of the week and sometiems it has 12
Horizontal columns if it is displaying months of the year. So I tried
to design a versital chart for multiple uses so I only have to make
chages to one block of code.

Thanks in advance for any help, or anythign that can point me in the
right direction.

// below is the pop up link in my web page //
function cm2ch0 ()
{popupwindow = window.open('acc_chart1.asp?vars=7&title=COALMILL 2 TPH
VS
KWT&DATE1=10/31/2011&DATE2=11/6/2011&DA1=17.87&DA2=13.53&DA3=14.12&DA4=15.38&DA5=14.93&DA6=16.75&DA7=17.08&DB1=20.42&DB2=23.58&DB3=21.90&DB4=20.92&DB5=22.62&DB6=21.53&DB7=20.71','popupwindow','width=600,height=300,scrollbars=no,resizeable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=100,top=50')


//below is my coded web page //

<html>
<head>
<script type="text/javascript" src="https://www.google.com/
jsapi"></script>
<script type="text/javascript">
// get url parameters (gup)
function gup( name ){ name = name.replace(/[\[]/,"\\\
[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];}
// declare variables and arrays
var parm = gup('vars');
var param = parseInt(parm);
var chtit = gup('title');
Dsa = new Array();
Dsb = new Array();
Dna = new Array();
Dnb = new Array();
if (param > 11)
{
var hlab = new
Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER");
}
else
{
var hlab = new
Array("MON","TUE","WED","THUR","FRI","SAT","SUN");
}

//fill data arrays for the charts from the parameters pulled from
the url. Also converts the strings parameters to numbers
var i=0;
for (i=0;i<=param-1;i++)
{
Dsa[i] = gup('DA' + (i+1));
Dna[i] = parseFloat(Dsa [i].replace(",",""));
Dsb[i] = gup('DB' + (i+1));
Dnb[i] = parseFloat(Dsb [i].replace(",",""));
}


google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'horizontal');
data.addColumn('number', 'TPH');
data.addColumn('number', 'KWT');
data.addRows(param);
var j=0;
for (j=0;j<=param-1;j++)
{
data.setValue(j, 0, hlab[j]);
data.setValue(j, 1, Dna[j]);
data.setValue(j, 2, Dnb[j]);
}

//Set chart options
var options = {'title': chtit,
'width': 600,
'height': 250,
'series':{0:{targetAxisIndex:0},1:{targetAxisIndex:
1}},
'vAxes':{0:{textStyle:
{color:'blue',fontName:'Arial',fontSize:12},color:'blue'},1:{textStyle:
{color:'red',fontName:'Arial',fontSize:12},color:'red'}},
'hAxes':{maxAlternation:1}
};
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
function PrintPage()
{
if (window.print)
window.print('chart_div');
}
</script>
<link rel="stylesheet" type="text/css" href="ac_styles.css">
</head>
<title>CHART</title>
<body>
<div id="chart_div"></div>
</body>

asgallant

unread,
Dec 13, 2011, 2:58:03 PM12/13/11
to google-visua...@googlegroups.com
Well, this one was a pain to debug for something so simple to fix: you have 'hAxes' in your options when you want 'hAxis'
Reply all
Reply to author
Forward
0 new messages