google.load("visualization", "1", {packages:["corechart", 'controls']});
var chart, data;
function ajax_pie_chart_call(data, limit) {

    var data2 = google.visualization.arrayToDataTable(data);
  
  // Define a slider control for the 'Donuts eaten' column
        var slider = new google.visualization.ControlWrapper({
          'controlType': 'NumberRangeFilter',
          'containerId': 'control1',
          'options': {
            'filterColumnLabel': data[0][1],
            'backgroundColor':'#ccc',
            'ui': {'labelStacking': 'vertical'}
          }
        });

        // Define a pie chart
        var piechart = new google.visualization.ChartWrapper({
          'chartType': 'PieChart',
          'containerId': 'piechart',
          'options': {
            'backgroundColor': {'fill':'#f1f1f1', 'strokeWidth':0, 
'stroke':'#f1f1f1'},
            'width': '50%',
            'height': 500,
            'legend': 'right',
            'chartArea': {'left': 15, 'top': 15, 'right': 0, 'bottom': 0},
            'pieSliceText': 'value'
          }
        });
  
  // $("#control1").show();

        google.visualization.events.addListener(piechart, 'select', 
eventHandler);       

          // Create the dashboard & Draw the chart
        var chart = new 
google.visualization.Dashboard(document.getElementById('piechart_total')).bind(slider,
 
piechart);

        chart.draw(data2);

        function eventHandler() {
          console.log(piechart.getSelection();
        }


        
}

-- 
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to