Google Chart错误:b.L不是函数 [英] Google Chart error: b.L is not a function
问题描述
我使用Google API制作了一个带有3个图形的小页面。
一切都很完美。然而从一瞬间到另一个崩溃。
在地图的图表中出现这样的消息:bL不是函数
有人可以向我解释为什么会发生这种情况吗?
我的示例工作:
< script type =text / javascriptsrc =https ://www.google.com/jsapi>< /脚本>
< script>
google.load(visualization,1,{packages:[corechart]});
google.setOnLoadCallback(drawChart);
函数drawChart(){
var data = new google.visualization.DataTable();
data.addColumn('string','Date');
data.addColumn('number','2015');
data.addColumn('number','2014');
data.addRows([
['Jan',197680,241921],
['Fev',183619,205572],
['Mar',205643,214666] ,
['Abr',205643,202097],
['Mai',0,210007],
['Jun',0,202434],
['Jul ',0,217502],
['Ago',0,175038],
['Set',0,206510],
['Out',0,209802],
['Nov',0,197122],
['Dez',0,162796]
]);
var options = {
title:'Energia 2014/2015',
titleTextStyle:{color:'white',fontSize:'18'},
chart_M :'function',
legend:{textStyle:{color:'white'}},
colors:['#0099FF','#11334c'],
backgroundColor:transparent ,
hAxis:{title:'',
textStyle:{
color:'#C8C8C8'
}},
vAxis:{title:'',
textStyle:{
color:'#C8C8C8'
}}
};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_energy'));
chart.draw(data,options);
}
< / script>
这就是它的工作原理。
从一刻起到另一个是如此。
谢谢所有回覆。 / p>
< script type =text / javascriptsrc =https://www.google.com/jsapi> < /脚本> b
< script type =text / javascriptsrc =https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version ':' 1.1' , '包':[ 'corechart']}]}>< /脚本>
它对我来说很好。
很奇怪,但事实是,它正在工作。
I did a little page with 3 graphics using the Google API.
Everything worked perfectly. However from one moment to the other crashed.
In the chart of the place appears this message: bL is not the function
Does someone can explain to me why this happens?
My example working:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script>
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Date');
data.addColumn('number', '2015');
data.addColumn('number', '2014');
data.addRows([
['Jan', 197680, 241921],
['Fev', 183619,205572],
['Mar', 205643,214666],
['Abr', 205643,202097],
['Mai', 0,210007],
['Jun', 0,202434],
['Jul', 0,217502],
['Ago', 0,175038],
['Set', 0,206510],
['Out', 0,209802],
['Nov', 0,197122],
['Dez', 0,162796]
]);
var options = {
title: 'Energia 2014/2015',
titleTextStyle: {color: 'white', fontSize: '18'},
chart_M: 'function',
legend: {textStyle: {color: 'white'}},
colors: ['#0099FF', '#11334c'],
backgroundColor: "transparent",
hAxis: {title: '',
textStyle: {
color: '#C8C8C8'
}},
vAxis: {title: '',
textStyle: {
color: '#C8C8C8'
}}
};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_energy'));
chart.draw(data, options);
}
</script>
This is how it was working.
From one moment to the other was so.
Thank you for all reply.
I changed it
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
to this:
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart']}]}"></script>
and it works fine for me.
Is very strange, but the truth is that it was working.
这篇关于Google Chart错误:b.L不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!