如何在Google图表中添加功能价值?

时间:2013-07-07 16:08:35

标签: charts

我想在Google可视化图表中使用功能值。但这不起作用,为什么?我使用以下代码:

 google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004',  200,    <script language="Javascript">display('2')</script>],
          ['2005',  1170,      460],
          ['2006',  660,       1120],
          ['2004',  200,      400],
          ['2005',  1170,      460],
          ['2006',  660,       1120],


          ['2007',  1030,      540]
        ]);

        var options = {
          title: 'Company Performance',
          hAxis: {title: 'Year', titleTextStyle: {color: 'red'}}
        };

        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }

0 个答案:

没有答案