我有一个饼图,其中图例的位置设置为'已标记',因此切片描述和值放在饼图旁边的一行上.我现在要做的是将切片与匹配图例连接的线的颜色更改为相应切片的颜色.
legend.textStyle或其他允许此更改的地方是否有任何属性?
这是我的代码:
function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
// Create and draw the visualization.
new google.visualization.PieChart(document.getElementById('visualization')).
draw(data, {
width: '800',
height: '400',
title: "So, how was your day?",
legend: {
position: 'labeled',
textStyle: {
color: 'gray' // sets the text color
}
}
});
}
Run Code Online (Sandbox Code Playgroud)
非常感谢!
问候,安迪