legend: {
show: true, //是否显示
type: "plain", // 图例的类型 'plain':普通图例 'scroll':可滚动翻页的图例
zlevel: 1, // 所有图形的 zlevel 值。
icon: "circle",
top: "5%",
right: "5%",
width: "auto",
height: "auto",
orient: "horizontal",
align: "auto",
padding: 5,
itemWidth: 6,
itemGap: 20,
itemHeight: 14,
symbolKeepAspect: true,
formatter: function (name) {
return '{a|text}{a| }{b|' + name + '}'
},
selectedMode: true, // 图例选择的模式,
inactiveColor: "#ccc", // 图例关闭时的颜色。
textStyle: {
color: "#556677",
fontStyle: "normal",
fontWeight: "normal",
fontFamily: "sans-serif",
fontSize: 12,
lineHeight: 20,
backgroundColor: "transparent",
borderColor: "transparent",
borderWidth: 0,
borderRadius: 0,
padding: 0,
shadowColor: "transparent",
shadowBlur: 0,
shadowOffsetX: 0,
shadowOffsetY: 0,
textBorderColor: "transparent",
textBorderWidth: 0,
textShadowColor: "transparent",
textShadowBlur: 0,
textShadowOffsetX: 0,
textShadowOffsetY: 0,
rich: {
a: {
color: "red",
lineHeight: 10,
},
b: {
color: "#fff",
lineHeight: 10,
},
},
},
},
参考: blog.csdn.net/weixin_4932…