Hi I am tryning, display a pie chart by call ajax. The call ajax works, 
when I inspect page I see the div with many somethings, namely, It is not 
empty. 

<script type="text/javascript" 
src="https://www.gstatic.com/charts/loader.js";></script>
google.charts.load('current', {'packages': ['corechart', 'bar', 'table'], 
'language': 'es', callback: function(){
            $("#formDiarioango").submit(drawChart);
        }            
    });



 function drawChart(event) {
        event.preventDefault();
               
        // viene la petición ajax
        $.ajax({
             url: $(this).attr('action'),
             type: 'post',
             data: $(this).serialize(),
             dataType: "json",
             success: function(rta){
                                                   
                // material en el mes
                var data = google.visualization.arrayToDataTable([
                    ['Material', 'cantidad'],
                    ['Organico', rta.tipoMateriales["organico"]],
                    ['Reciclable', rta.tipoMateriales["reciclable"]],
                    ['No aprovechable', 
rta.tipoMateriales["noAprovechable"]]
                ]);

                var options = {
                    title: 'Tipo de materiales recolectados (Kg) en el mes'
                };
                var chart = new 
google.visualization.PieChart(document.getElementById('tipo_material_mes'));
                chart.draw(data, options);  
             }
        });
}

The div is empty  before of call with ajax, it has content later of the 
call, but does not show anything apart from the title of the graph and 
inspecting the code has something inside [as seen in the attached image]. 



Alguna idea, sugerencia para resolver mi problema estaré muy agradecido. Lo 
siento por mi inglés 

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
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/b1abf8e1-9ce6-47dc-ac6c-26b9edb85c42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to