我正在使用google bar chart。我想用蓝色迷你矩形删除右侧文字,我用红色圆圈标记。请参见下图: -
这是我的代码: -
var data = new google.visualization.DataTable();
data.addColumn('string', 'Household Income');
data.addColumn('number', 'Holder');
data.addRows([
['Under 20K', resdata[0].un20],
['20 to 50K', resdata[0].fr20to50],
['50 to 75K', resdata[0].fr50to75],
['75 to 100K', resdata[0].fr75to100],
['100 to 150K', resdata[0].fr100to150],
['150 to 250K', resdata[0].fr150to250],
['250K and up', resdata[0].up250]
]);
var options = {};
// Instantiate and draw the chart.
var chart = new google.visualization.BarChart(document.getElementById('myBarChart'));
chart.draw(data, options);
答案 0 :(得分:2)
在初始配置对象中使用legend.position = "none"
。有关配置选项的进一步说明,请参阅API文档(https://developers.google.com/chart/interactive/docs/gallery/barchart#configuration-options)。