为什么 titleTextStyle 不能与 Google 图表中的标题选项一起使用?

Why is titleTextStyle not working with the title option in Google Charts?

我正在使用 Google 图表和从 Mysql 数据库中获取的数据创建一个简单的条形图。图表显示正确,但我无法设置图表标题的格式。我参考了很多网站,我确信 'titleTextStyle' 的语法没问题。但是标题根本不会随着选项而改变。有人可以告诉我问题出在哪里吗? 我在下面附上了我的完整代码。 提前致谢。

<?php 

    include("toconnect.php");
    $result = mysqli_query($connection,"SELECT Product_name,COUNT(*)  FROM Items_Sold GROUP BY Product_name");

?>

<!DOCTYPE html>
<html lang="en">
  <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([
          ['Product Name', 'Frequency'],
          <?php 
            if(mysqli_num_rows($result) > 0){
                    while($row = mysqli_fetch_array($result))
                    {
                            echo "['".$row["Product_name"]."','".$row["COUNT(*)"]."'],";
                    }
            }
          ?>
        ]);

        var options = {
          chart: {
            title: "Frequently Bought items",titleTextStyle:{ color: '#007DB0',fontName: "Times",fontSize: 60,bold: true},
        }
        };
        var chart = new google.charts.Bar(document.getElementById('columnchart_material'));

        chart.draw(data, google.charts.Bar.convertOptions(options));
      }
    </script>
  </head>
  <body>
    <div id="columnchart_material" style="width: 800px; height: 500px;display:inline-block;"></div>
  </body>
</html>

您正在使用 material 图表...

google.charts.Bar

Material 图表中不起作用的功能列表可以在这里找到...

Tracking Issue for Material Chart Feature Parity #2143

其中包括...

titleTextStyle


尝试使用 经典 图表...

google.visualization.ColumnChart

有选项...

theme: 'material'