我剛剛開始使用HTML5和JQuery。我將在導航欄上顯示一個Google柱狀圖。我有以下代碼,但它不顯示popover內的圖表。有人可以幫我解決這個問題嗎?謝謝。如何在HTML5彈出窗口中顯示Google圖表
<a id="electricity" class="action" rel="popover">Elpriser</a>
<script>
$("#electricity")
.popover(
{ placement : 'top', html : true,
content : '<div class="popover-content-el"><div class="lable-electricity"><h3>Nordpool</h3></div><div id="chart_div" style="width: 300px; height: 200px;"></div></div>'
});
</script>
<script type="text/javascript">
google.load("visualization", "1", {
packages : [ "corechart" ]
});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
[ 'SE1', 'Idag', 'Imorgon' ], [ 'SE1', 1170, 460 ],
[ 'SE2', 1170, 460 ], [ 'SE3', 660, 1120 ],
[ 'SE4', 1030, 540 ] ]);
var options = {
vAxis : {
textPosition : 'none',
gridlines : {
color : "#ffffff"
}
},
};
var chart = new google.visualization.ColumnChart(document
.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
我能看到的問題,而是演示一個解決方案,我們就需要知道你正在使用的酥料餅插件 – PerryW 2013-05-07 23:57:16