I am getting an error "Cannot read property 'prototype' of null" whenever I 
am trying to create a chart.

The code follows:

<script type="text/javascript" 
src="https://www.gstatic.com/charts/loader.js";></script>


<script type="text/javascript">
    // Load the Visualization API and the controls package.
    google.charts.load('current', { 'packages': ['controls'] });

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

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

        // Create our data table.
        var data = google.visualization.arrayToDataTable([
          ['Name', 'Donuts eaten'],
          ['Michael', 5],
          ['Elisa', 7],
          ['Robert', 3],
          ['John', 2],
          ['Jessica', 6],
          ['Aaron', 1],
          ['Margareth', 8]
        ]);

        // Create a dashboard.
        var dashboard = new google.visualization.Dashboard(
            document.getElementById('programmatic_dashboard_div'));

        // Create a range slider, passing some options
        var donutRangeSlider = new google.visualization.ControlWrapper({
            'controlType': 'NumberRangeFilter',
            'containerId': 'programmatic_control_div',
            'options': {
                'filterColumnLabel': 'Donuts eaten'
            }
        });

        // Create a pie chart, passing some options
        var pieChart = new google.visualization.ChartWrapper({
            'chartType': 'PieChart',
            'containerId': 'programmatic_chart_div',
            'options': {
                'width': 300,
                'height': 300,
                'pieSliceText': 'value',
                'legend': 'right'
            }
        });

        // Establish dependencies, declaring that 'filter' drives 
'pieChart',
        // so that the pie chart will only display entries that are let 
through
        // given the chosen slider range.
        dashboard.bind(donutRangeSlider, pieChart);

        // Draw the dashboard.
        dashboard.draw(data);
    }
    </script>
  <body>
    <div id="programmatic_dashboard_div" style="border: 1px solid #ccc">
      <table class="columns">
        <tr>
          <td>
            <div id="programmatic_chart_div" style="width:800px; 
height:300px"></div>
          </td>
           
        </tr>
          <tr>
              <td>
              <div id="programmatic_control_div" style="width:800px; 
height:50px"></div>
                  </td>
          </tr>
      </table>
    </div>
  </body>




Error screen from chrome console is attached. Please help me out its kind 
of urgent

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/309c9cfb-03c2-44f7-8007-43fed7958f0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to