簡體   English   中英

Google圖表未顯示在瀏覽器中

[英]Google charts not displaying on browser

下面是我用於顯示Chart的代碼。 我不確定這里出了什么問題。

請多多包涵,這是我第一次在這個論壇上提問。

謝謝您的幫助

<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
  google.charts.load('current', {'packages':['bar']});
  google.charts.setOnLoadCallback(DrawChart);
  function DrawChart() {
    var data = google.visualization.arrayToDataTable([
      ['Short Shipment', 'Product Questions', 'Product Service Request', 'Billing Question','Product Issue','Return or Exchange Request','- None -'],
      [1, 3, 4, 8, 8, 11, 283]]);


    var options = {
      chart: {
        title: 'Case Issue Summary'

      },
      bars: 'horizontal' 
    };

    var chart = new google.charts.Bar(document.getElementById('BarChartCase'));

    chart.draw(data, options);
  }
</script>
</head>
<body padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
<div id="BarChartCase" style="width: 200px; height: 100px;">&nbsp;</div>
</body>

</html>

您的代碼是從developers.google.com/chart / ....復制的99/100。

您所做的唯一更改是將widthheight為200和100。

將其更改為更大的數字,您將能夠看到您的條形圖。

代碼筆復制

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM