【发布时间】:2019-01-26 15:35:50
【问题描述】:
【问题讨论】:
-
尝试将
legend.position向右移动,或在顶部增加maxLines... -
感谢 WhiteHat,但它对我不起作用..
标签: legend pie-chart google-visualization legend-properties
【问题讨论】:
legend.position 向右移动,或在顶部增加maxLines...
标签: legend pie-chart google-visualization legend-properties
正如WhiteHat在他的评论中提到的,你必须将legend.position移到顶部并增加maxLines。
但另外,您必须将top 属性添加到chartArea,以便在图表顶部获得足够的空间。
{
width: '100%',
height: '100%',
legend: {
position: 'top', // <--- top position
alignment: 'center',
maxLines: 5 // <--- increase of max lines
},
chartArea: {
height: "100%",
width: "100%",
top: "25%" // <-- top space (you can use fix values as well. (e.x. 50))
},
sliceVisibilityThreshold: 0,
pieHole: 0.4,
}
【讨论】: