b[c] is undefined error in Firefox

1,141 views
Skip to first unread message

omanit

unread,
Oct 20, 2011, 2:29:53 PM10/20/11
to Google Visualization API
The example code works fine as a independent page as itself. But if
incorporated into my jsf web app, it throws error in Firefox: " b[c]
is undefined" . How to debug if the error happens in the google chart
JS ? Any suggestions will be helpful
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/
jsapi"></script>
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is
loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {

// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['Mushrooms', 3],
['Onions', 1],
['Olives', 1],
['Zucchini', 1],
['Pepperoni', 2]
]);

// Set chart options
var options = {'title':'How Much Pizza I Ate Last Night',
'width':400,
'height':300};

// Instantiate and draw our chart, passing in some options.
var chart = new
google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>

<body>
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</body>
</html>

Viz Kid

unread,
Oct 23, 2011, 4:49:59 AM10/23/11
to google-visua...@googlegroups.com

Hi

Without knowing anything about your page, giving an insight would be hard.
What I suggest is for you to try and narrow down your page to the minimal example that still causes this issue, and hopefully you can also share this example with us.
Moreover, if you are using any external libraries which potentially modify some basic built-in Javascript types, they might cause unexpected behavior.

  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.


vergeles...@gmail.com

unread,
Jan 17, 2013, 3:53:08 AM1/17/13
to google-visua...@googlegroups.com
Hi, I have similar problem in my Jboss Seam 2 project. I use simple example from Google Visualization Quick start and when I put that page to my Jboss Seam 2 project I got the same error "b[c] is undefined".

The below is the generated page source.

As you can see Jboss Seam adds some other script srcs for a4j.

Is it possible that a4j javascript conflicts with google visualization api javascript?

Is there any idea how to resolve this?



<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

     <script src="/MCMS/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js" type="text/javascript"></script>
     <script src="/MCMS/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js" type="text/javascript"></script>
     <link class="component" href="/MCMS/a4j/s/3_3_3.Final/org/richfaces/skin.xcss/DATB/eAGTKJ8eErp8hjQADcsDKg__" rel="stylesheet" type="text/css" />
     <script type="text/javascript" src="https://www.google.com/jsapi"></script>
     <script type="text/javascript">
          // Load the Visualization API and the piechart package.
          google.load('visualization', '1.0', {'packages':['corechart']});

          // Set a callback to run when the Google Visualization API is loaded.
          google.setOnLoadCallback(drawChart);

          // Callback that creates and populates a data table,
          // instantiates the pie chart, passes in the data and
          // draws it.
          function drawChart() {

          // Create the data table.
          var data = new google.visualization.DataTable();
          data.addColumn('string', 'Topping');
          data.addColumn('number', 'Slices');
          data.addRows([
          ['Mushrooms', 3],
          ['Onions', 1],
          ['Olives', 1],
          ['Zucchini', 1],
          ['Pepperoni', 2]
        ]);

        // Set chart options
        var options = {'title':'How Much Pizza I Ate Last Night',
                   'width':400,
                   'height':300};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
 </head>

 <body>

    <div id="chart_div"></div>
 </body>
</html>


Неділя, 23 жовтня 2011 р. 11:49:59 UTC+3 користувач Viz Kid написав:
  Viz Kid

To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.

Daniel LaLiberte

unread,
Jan 17, 2013, 9:00:20 AM1/17/13
to google-visua...@googlegroups.com

dan


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.



--
dlaliberte@Google.com   562D 5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

vergeles...@gmail.com

unread,
Jan 17, 2013, 5:14:29 PM1/17/13
to google-visua...@googlegroups.com
Yes, I have found the solution and published it on stackoverflow.
Anyway, thank you for paying attention to my question.

Petro.

Четвер, 17 січня 2013 р. 16:00:20 UTC+2 користувач Daniel LaLiberte написав:
dan

  Viz Kid

To unsubscribe from this group, send email to google-visualization-api+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/qXN4LCOg1-EJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



--
dlali...@Google.com   562D 5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA
Reply all
Reply to author
Forward
0 new messages