Center Align Title Google Chart

Turnercj65 picture Turnercj65 · Jun 29, 2012 · Viewed 36.5k times · Source

How can I center the title in a Line Chart from Google Charts API (Not Google Chart Images)

I don't see any options like titlePosition: 'center'

Thanks!

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);
}

Answer

Lightness Races in Orbit picture Lightness Races in Orbit · Jan 31, 2013

This option is not provided by the API; you simply cannot do this.