Incompatible series types BarChart

1,405 views
Skip to first unread message

Otto Walker

unread,
Jan 19, 2011, 6:32:17 PM1/19/11
to Google Visualization API
Hi There,

Today I started to get this error message on a Bar Chart.
"Incompatible series types."

Here is the data that I want to show in json format:

{"cols":

[{"id":"PRIMARY_DESC","label":"Value","type":"string","pattern":""},
{"id":"FREQ","label":"Frequency","type":"number","pattern":""}],

"rows":
[{"c":[{"v":"Strongly Agree"},{"v":1097}]},
{"c":[{"v":"Agree"},{"v":473}]},
{"c":[{"v":"Neither Agree nor Disagree"},{"v":39}]},
{"c":[{"v":"Disagree"},{"v":5}]},
{"c":[{"v":"Strongly Disagree"},{"v":2}]},
{"c":[{"v":"Don't Know"},{"v":4}]},
{"c":[{"v":"Refused"},{"v":10}]}],
"p":null
}

any ideas?

Viz Kid

unread,
Jan 20, 2011, 1:58:50 AM1/20/11
to google-visua...@googlegroups.com

Hi

I've just tried your example using a BarChart and it worked fined. Can you give the complete example you are using, and not just the json snippet of it?

  Viz Kid


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Ross

unread,
Jan 20, 2011, 7:21:02 AM1/20/11
to Google Visualization API
This may not be quite related to the original OP, but I've also just
started getting this problem. It seems to be whenever my data
contains a value of 0. It's a problem for both the Bar and Column
chart types.

On Jan 20, 6:58 am, Viz Kid <viz...@google.com> wrote:
> Hi
>
> I've just tried your example using a BarChart and it worked fined. Can you
> give the complete example you are using, and not just the json snippet of
> it?
>
>   Viz Kid
>
> On Thu, Jan 20, 2011 at 1:32 AM, Otto Walker <otoniel.venezu...@gmail.com>wrote:
>
>
>
> > Hi There,
>
> > Today I started to get this error message on a Bar Chart.
> > "Incompatible series types."
>
> > Here is the data that I want to show in json format:
>
> > {"cols":
>
> > [{"id":"PRIMARY_DESC","label":"Value","type":"string","pattern":""},
> >    {"id":"FREQ","label":"Frequency","type":"number","pattern":""}],
>
> > "rows":
> >    [{"c":[{"v":"Strongly Agree"},{"v":1097}]},
> >    {"c":[{"v":"Agree"},{"v":473}]},
> >    {"c":[{"v":"Neither Agree nor Disagree"},{"v":39}]},
> >    {"c":[{"v":"Disagree"},{"v":5}]},
> >    {"c":[{"v":"Strongly Disagree"},{"v":2}]},
> >    {"c":[{"v":"Don't Know"},{"v":4}]},
> >    {"c":[{"v":"Refused"},{"v":10}]}],
> > "p":null
> > }
>
> > any ideas?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Visualization API" group.
> > To post to this group, send email to
> > google-visua...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-visualizati...@googlegroups.com<google-visualization-­api%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-visualization-api?hl=en.- Hide quoted text -
>
> - Show quoted text -

Viz Kid

unread,
Jan 20, 2011, 7:28:52 AM1/20/11
to google-visua...@googlegroups.com
This is indeed not related. You can follow the status of this issue here:

  Viz Kid

To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.

Otto Walker

unread,
Jan 20, 2011, 11:01:20 AM1/20/11
to Google Visualization API
a co-worker will put more details in a second, we think it is a issue
with Mootools 1.3.0 because we are not getting the error with 1.2.5
version.
what drives us crazy is that we have a static copy of Mootools locally
and that didn't changed... we are doing a diff and see what we can
find.
-O

On Jan 20, 1:58 am, Viz Kid <viz...@google.com> wrote:
> Hi
>
> I've just tried your example using a BarChart and it worked fined. Can you
> give the complete example you are using, and not just the json snippet of
> it?
>
>   Viz Kid
>
> On Thu, Jan 20, 2011 at 1:32 AM, Otto Walker <otoniel.venezu...@gmail.com>wrote:
>
> > Hi There,
>
> > Today I started to get this error message on a Bar Chart.
> > "Incompatible series types."
>
> > Here is the data that I want to show in json format:
>
> > {"cols":
>
> > [{"id":"PRIMARY_DESC","label":"Value","type":"string","pattern":""},
> >    {"id":"FREQ","label":"Frequency","type":"number","pattern":""}],
>
> > "rows":
> >    [{"c":[{"v":"Strongly Agree"},{"v":1097}]},
> >    {"c":[{"v":"Agree"},{"v":473}]},
> >    {"c":[{"v":"Neither Agree nor Disagree"},{"v":39}]},
> >    {"c":[{"v":"Disagree"},{"v":5}]},
> >    {"c":[{"v":"Strongly Disagree"},{"v":2}]},
> >    {"c":[{"v":"Don't Know"},{"v":4}]},
> >    {"c":[{"v":"Refused"},{"v":10}]}],
> > "p":null
> > }
>
> > any ideas?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Visualization API" group.
> > To post to this group, send email to
> > google-visua...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-visualizati...@googlegroups.com<google-visualization-api%2Bunsu...@googlegroups.com>
> > .

Otto Walker

unread,
Jan 20, 2011, 1:04:26 PM1/20/11
to Google Visualization API
so yes.. the issue is with MooTools 1.3 version.

If you just include it then you start getting the error.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/
libs/mootools/1.3.0/mootools.js">

I tested on the playground as well.

-Otto

Otto Walker

unread,
Jan 20, 2011, 1:10:30 PM1/20/11
to Google Visualization API
Below is the BarChart interactive example and I just included Mootols
1.3 version.

<!--
You are free to copy and use this sample in accordance with the terms
of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
<title>
Google Visualization API Sample
</title>

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/
libs/mootools/1.3.0/mootools.js"></script>

<script type="text/javascript" src="http://www.google.com/jsapi"></
script>



<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart']});
</script>
<script type="text/javascript">
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
var raw_data = [['Austria', 1336060, 1538156, 1576579,
1600652, 1968113, 1901067],
['Bulgaria', 400361, 366849, 440514, 434552,
393032, 517206],
['Denmark', 1001582, 1119450, 993360, 1004163,
979198, 916965],
['Greece', 997974, 941795, 930593, 897127,
1080887, 1056036]];

var years = [2003, 2004, 2005, 2006, 2007, 2008];

data.addColumn('string', 'Year');
for (var i = 0; i < raw_data.length; ++i) {
data.addColumn('number', raw_data[i][0]);
}

data.addRows(years.length);

for (var j = 0; j < years.length; ++j) {
data.setValue(j, 0, years[j].toString());
}
for (var i = 0; i < raw_data.length; ++i) {
for (var j = 1; j < raw_data[i].length; ++j) {
data.setValue(j-1, i+1, raw_data[i][j]);
}
}

// Create and draw the visualization.
new
google.visualization.BarChart(document.getElementById('visualization')).
draw(data,
{title:"Yearly Coffee Consumption by Country",
width:600, height:400,
vAxis: {title: "Year"},
hAxis: {title: "Cups"}}
);
}


google.setOnLoadCallback(drawVisualization);
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="visualization" style="width: 600px; height: 400px;"></
div>
</body>
</html>

Otto Walker

unread,
Jan 20, 2011, 3:34:09 PM1/20/11
to Google Visualization API
This is what my Co-worker found:

"You can further isolate the issue to the 1.3.0 version by changing
the Mootools script reference src to https://ajax.googleapis.com/ajax/
libs/mootools/1.2.5/mootools.js". I've been able to identify one
change in 1.3.0 that if applied to 1.2.5 will reproduce the error.
The issue I've found is that 1.3.0 adds a '$constructor' member to the
Array object's prototype. There could be other issues however, as
version 1.2.4 adds 16 items to Array whereas 1.3.0 adds 40. To
reproduce the error with 1.2.5 modify the 'Native' variable definition
by adding the following line after line 43.

object.prototype.$constructor = object;

I came to suspect the Array class by debugging through the compressed
and obfuscated javascript source code returned from the 'google.load'
call. If you search through the code for the 'Incompatible series
types' message you will find the following line just above it.

a = a.series || [];

This 'a' variable then gets passed to another function along with an
anonymous function that contains the error message. All that this
function does is use 'a' in a 'for/in' loop calling the anonymous
function with each entry in 'a'. The error in the anonymous function
is encountered when processing the '$constructor' member of the 'a'
Array."
Message has been deleted

Niek

unread,
Jan 25, 2011, 4:26:58 AM1/25/11
to Google Visualization API
I also reported this issue on the google-visualization-api-issues
tracker, see: http://code.google.com/p/google-visualization-api-issues/issues/detail?id=504

If anyone knows a workaround: please post it.

On Jan 20, 9:34 pm, Otto Walker <otoniel.venezu...@gmail.com> wrote:
> This is what my Co-worker found:
>
> "You can further isolate the issue to the 1.3.0 version by changing
> the Mootools script reference src tohttps://ajax.googleapis.com/ajax/

Viz Kid

unread,
Jan 25, 2011, 1:28:40 PM1/25/11
to google-visua...@googlegroups.com

We have pushed a small fix to this issue to our release candidate version (1.1). Please try this as a workaround for now and let us know if you encounter any other issues.

Best,
  Viz Kid

To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages