Does not display data

27 views
Skip to first unread message

Beto

unread,
Mar 20, 2015, 5:37:35 AM3/20/15
to google-visua...@googlegroups.com
Hello,

I have a code other than the graphics is, as I have not much knowledge helps to ask friends forum. I get the following message instead of the graphics:

"In stats available yet!"


Below part of the code:


I appreciate if you can help me



        var data1 = <?php echo json_encode($data1); ?>;
var data2 = <?php echo json_encode($data2); ?>;
var data3 = <?php echo json_encode($data3); ?>;
var data4 = <?php echo json_encode($data4); ?>;
var data5 = <?php echo json_encode($data5); ?>;
var data6 = <?php echo json_encode($data6); ?>;
var data7 = <?php echo json_encode($data7); ?>;
var data8 = <?php echo json_encode($data8); ?>;
        var compatibleMode = false;
function loadGraph(div, data, title2, typer){
        var o = {
            titleTextStyle:{color:'#444'},
title: title2,
            tooltip:{textStyle: {fontSize: '12'}},  
            hAxis:{textPosition: 'none', title:'',  titleTextStyle: {fontSize: '11', color: '#444'}},
            vAxis:{minValue:0},
chartArea:{left: '50', top: '15', width: '75%',right: 200},
backgroundColor:{stroke: 'white'},
hAxis: {title: '<?=$Lang->t("Day")?>'},
vAxis: {title: '<?=$Lang->t("Amount")?>'},
        };

d = google.visualization.arrayToDataTable(data);
if(d.tf){
if(typer == 'pie'){
           var c = compatibleMode ? new google.visualization.ColumnChart(document.getElementById(div)) : new google.visualization.PieChart(document.getElementById(div));
          c.draw(d, o);
}
else if(typer == 'column'){
           var c = compatibleMode ? new google.visualization.ColumnChart(document.getElementById(div)) : new google.visualization.ColumnChart(document.getElementById(div));
          c.draw(d, o);
}
else if(typer == 'area'){
           var c = compatibleMode ? new google.visualization.ColumnChart(document.getElementById(div)) : new google.visualization.AreaChart(document.getElementById(div));
          c.draw(d, o);
}
}
else{
$('#'+div).html('<div class="grayish"><?=$Lang->t("No stats available yet!")?></div>');
}
}
    function macGa(){
       loadGraph('chart1', data1, '<?=$Lang->t("Messages")?>', 'area');
  loadGraph('chart2', data2, '<?=$Lang->t("Images")?>', 'area');
  loadGraph('chart3', data3, '<?=$Lang->t("Videos")?>', 'area');
  loadGraph('chart6', data6, '<?=$Lang->t("Audios")?>', 'area'); 
  loadGraph('chart4', data4, '<?=$Lang->t("Messages sent")?>', 'pie');
  loadGraph('chart5', data5, '<?=$Lang->t("Images sent")?>', 'pie');     
  loadGraph('chart7', data7, '<?=$Lang->t("Videos sent")?>', 'pie');
  loadGraph('chart8', data8, '<?=$Lang->t("Audios sent")?>', 'pie'); 
    }
$(document).ready(function(){
        var pkg = compatibleMode ? 'magelinechart' : 'corechart';
        google.load('visualization', '1', {packages:[pkg], callback:macGa});
});
</script>
<?php

Daniel LaLiberte

unread,
Mar 20, 2015, 8:59:42 AM3/20/15
to google-visua...@googlegroups.com
Hi Beto,

I suspect you mean that you see "No stats available yet!".  Since the code you posted is php, which runs on your server, we can't tell what it will generate in the browser.  Could you instead point us at the page that is generated?   

I would guess there is a problem with one of your data (1-8) assignments.  You might go into the browser debugger to see what is happening and be able to fix it yourself.


--
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-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



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

Beto

unread,
Mar 20, 2015, 9:58:02 AM3/20/15
to google-visua...@googlegroups.com
Hello Daniel,


I'm posting all code and sending a screen print

Thank you for support
--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA
chart.png
teste.php

Daniel LaLiberte

unread,
Mar 20, 2015, 1:18:56 PM3/20/15
to google-visua...@googlegroups.com
Hi Beto,


The image doesn't help me except to see that there is no chart.  And I can't do much with your php, partly because i don't know the language well enough, but moreover, I can only guess what is going on in your server.  So the code I need to see is what gets sent to the browser.  Go to your web page and do View Source.   Or better, just give me a link to your web page.  Send by private email if you would prefer.  

--
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-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



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

Usina ideia

unread,
Mar 20, 2015, 1:41:11 PM3/20/15
to google-visua...@googlegroups.com
Hello,

Thanks again.

Follow the link with username and password:


Username: altaenergia
Password: altaenergia@altaenergia


Thank You


Alberto

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/PTSNJdW-Gpk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

Daniel LaLiberte

unread,
Mar 20, 2015, 2:59:00 PM3/20/15
to google-visua...@googlegroups.com
The problem I see is that you are using a property of the generated data table that is internal to the API.   In your loadGraph function, you have this code:

d = google.visualization.arrayToDataTable(data);
if(d.tf){
                ..
               }

I don't know what property you were looking for, but that internal property name, "tf", will be changed each time we make a new release.  So you can't do that except as a temporary hack.  Instead, only use the advertised functions and properties that are documented here: https://developers.google.com/chart/interactive/docs/reference#DataTable



Usina ideia

unread,
Mar 20, 2015, 8:57:50 PM3/20/15
to google-visua...@googlegroups.com
Good night Daniel

Ok, I will look at the documentation and see if I can something.

For now thanks
Reply all
Reply to author
Forward
0 new messages