Chart Titles not Displaying?

4,991 views
Skip to first unread message

Yaani-Mai Gaddy

unread,
Jan 3, 2016, 2:40:56 PM1/3/16
to Google Visualization API
Well, I finally figured out how to display 2 Google column charts on one page here
http://racekarts.com/test6.html

The only problem I am having now is getting the chart title & sub title to display.

I have tried using this code for chart1

   // Set chart options
        var options1 = {title: '2015 GCKI Membership Stats',
                        subtitle: 'Total Members: 2015'};

I tried this code for chart2

 // Set chart options
        var options2 = {
          chart2: {
            title: '2015 GCKI Membership Stats',
            subtitle: 'New, Renewed & Expired members: 2015',
                      }
        };

But the title & subtitle do not show for wither chart.

Thank you for any help you can give with this problem!

Yaani-Mai Gaddy

unread,
Jan 3, 2016, 11:44:47 PM1/3/16
to Google Visualization API
Well, I couldn't figure out how to get the titles to display so I added titles using html.

If someone can tell me how to get the chart titles to display using the var options it would be greatly appreciated.

Thanks!

Daniel LaLiberte

unread,
Jan 4, 2016, 8:20:25 AM1/4/16
to Google Visualization API
The subtitle option only works with the material charts.   But for now, you also have to convert the options structure for use with material charts.  For the Column chart, use: google.charts.Column.convertOptions(options) instead place of your options.  Hope that helps.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/97b9dec5-7e46-4206-aaca-cda7b576ab4e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

William Green

unread,
Jun 30, 2017, 9:04:03 AM6/30/17
to Google Visualization API
Hi Yaani-Mai,

I put the word title in double quotes and the same with the title itself, like this:

var options = {
        "title": "Competencies",
        width: 540,
        height: 460
      };
  var data = response.getDataTable();
  var chart = new google.visualization.LineChart(document.getElementById('linechart'));
  chart.draw(data, options);

It worked. This is according to the Google Visualization API reference (https://developers.google.com/chart/interactive/docs/reference#visconstructor).

-Bill
Reply all
Reply to author
Forward
0 new messages