中心对齐标题谷歌图表

Tur*_*j65 17 javascript api charts center

如何将标题置于Google Charts API(不是Google图表图像)的折线图中心

我没有看到像titlePosition这样的选项:'center'

谢谢!

function drawVisualization() {
  // Create and populate the data table.
  var data = google.visualization.arrayToDataTable([
    ['xValues', 'yValues'],
    [0, 34.92],
    [389, 39.44],
    [488, 52.11],
    [652, 55.4]
  ]);

  var options = {
    curveType: 'none', // 'function'
    title: 'Title',
    titleTextStyle: {
      color: '333333',
      fontName: 'Arial',
      fontSize: 10
    },
    legend: 'none',
    enableInteractivity: false
  };

  var chart = new google.visualization.LineChart(document.getElementById('visualization'));
  chart.draw(data, options);
}
Run Code Online (Sandbox Code Playgroud)

Lig*_*ica 20

API不提供此选项; 你根本做不到这一点.


Wer*_*ner 10

我使用:titlePosition:'none'

并使用普通HTML插入标题