Labels for columns in a ColumnChart

13 views
Skip to first unread message

Alankar

unread,
Jul 7, 2011, 3:22:58 PM7/7/11
to Google Visualization API
Is it possible to make a ColumnChart not display the colored square
for a given column in the chart but just show the bars pertaining to
that column. For example if I create a DataTable like this-
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING);
data.addColumn(ColumnType.NUMBER));

and add values to it like this-
data.setValue(0, 0, "x");
data.setValue(0, 1, 15);
data.setValue(1, 0, "y");
data.setValue(1, 1, 20); and so on...

is it possible that I can make a ColumnChart to just show the bars
pertaining to the second column and not the colored square shown in
the top right corner if I set the data in it like this-
chart.draw(data, options); (you can ignore "options")

I am new to this API so if I sounded silly or not descriptive enough
in this question, please let me know.
Thanks,
Alankar

asgallant

unread,
Jul 8, 2011, 9:39:01 AM7/8/11
to google-visua...@googlegroups.com
I assume the "colored box" you are referring to is the legend.  In that case, to turn it off, set the "legend" option to "none":

chart.draw(data, {legend: 'none'});
Reply all
Reply to author
Forward
0 new messages